The Active Worlds UniServer needs to be able to send email messages in two different situations. The most common situation is where a citizen has forgotten his or her password and presses the "I forgot" button in the login dialog. The UniServer needs email access in order to send an email message to the user containing the password.
The other situation is in a for-pay universe when a registration is received and a notification email address has been specified in the [billing] section. See Enabling Registration for details.
Enabling email access is simply a matter of telling the UniServer the command it needs to invoke in order to send email, and the name of a file containing a template of the message to be sent. This is done by filling out the [mail] section of the universe.ini file. A typical [mail] section for a Unix UniServer would look like this:
[mail]
command=/usr/lib/sendmail
template=mail.txt
file=/tmp/awmail.txt
The command= field specifies the system command to invoke for sending email. The template= field specifies the name of a text file containing a template for the password email message (see below). Finally, the file= field specifies the location where the UniServer should temporarily store the final email message for sending.
When a user invokes the password mail back feature, the UniServer first creates the email message to be sent and stores it in the temporary file, then issues the following command to the system:
[command] [email address] < [temp file]
Given the sample configuration above, the actual command might look like this:
/usr/lib/sendmail username@myisp.com < /tmp/awmail.txt
Note that sendmail must have already been properly configured by the system administrator to send email or this mechanism will not work.
The template file
Password mail back also requires a template file describing the contents of the email message that is sent to the user. A typical template file might look like this:
From: Universe Support
Reply-To: support@yourdomain.com
To: %.*s
Subject: your password
Your password is '%.*s'.
If you did not request your password, please accept our apologies
and disregard this message.
Regards,
GreatUniverse, Inc.
The contents of this file can be pretty much anything you want, but placement of the headers at the top is the most important, as well as the locations of the two %.*s sequences. The first %.*s is where the user's email address is placed, and the second %.*s is where the user's password is placed.
The email template file cannot be longer than 2048 bytes.
Email under Windows
Sending email from a Windows UniServer requires the use of some extra utilities that are shipped with the Windows version. As a result the [mail] section of the universe.ini will look a bit different under Windows. A typical Windows mail configuration might look like:
[mail]
command=mailpw -from=support@yourdomain.com -subject="Your Password" -host=smtp.yourdomain.com
template=mail.txt
file=mail.tmp
This configuration will invoke the mailpw.exe utility to send the password email under Windows. If the -host= option is set to point at a valid SMTP server, this procedure should work. Be sure to change the support email address from the default example preset in the universe.ini file.