Mac OS X Unleashed

Mac OS X Unleashed

By John Ray and William C. Ray

Web-Based E-mail

There are a number of packages that you can install to create Web-based e-mail, such as FocalMail from http://home.focalmail.com/. In addition, the PHP Web development language has the capability to talk directly to the IMAP servers. The Horde Project has created a Web-based e-mail package called IMP that is available as a free download from www.horde.org/imp/2.3/.

If you're interested in an extremely easy to set up solution, you might want to check out the Majora software, which can be downloaded from www.poisontooth.com/.

Written in Perl, Majora is easy to understand and simple to set up. Assuming that you've enabled CGI support in Apache, you can add a Web front end to your mail server in a minute or two.

First, download and unarchive the Majora distribution, placing it in a Web-accessible directory. In this example, the files are placed in my local Sites directory:

[primal:~/Sites] jray% curl -o http://www.poisontooth.com/software/majora.tar.gz
[primal:~/Sites] jray% tar zxf majora.tar.gz

Next, cd into the Majora directory and open the file majora.cgi. There are a few lines at the start of the file that can be configured to better suit your site.

The following lines affect the coloring of the message output table. Alter the colors to adjust the HTML display in the client browser:

#### Color information for the display
$NormalColor="BGCOLOR=\"#FFFFE9\"";
$SelectedColor="BGCOLOR=\"#A0A0DD\"";
$HeadingColor="BGCOLOR=\"#D3D3FA\"";
$NumberColor="BGCOLOR=\"#CDCDDD\"";
$SubjectColor="BGCOLOR=\"#FFEDED\"";
$DateColor="BGCOLOR=\"#EDFFED\"";

When viewing messages in a Web browser, you don't want to worry about downloading several megabytes of attachments to the remote Web browser. To get around this potential problem, set the $bigmessage variable to the largest message size (in bytes) to transfer.

#### Largest message (in bytes) to allow the user to view online
$bigmessage=10000;

The variable $popmailcgi should only be changed if, for some reason, you've modified the name of the Majora CGI.

#### URL to this CGI
$popmailcgi="majora.cgi";

Finally, the $smtpserver and $thishost variables should be set to the SMTP server that will be used for sending e-mail, and the hostname of the local computer, respectively.

#### SMTP server used to send mail...
$smtpserver="poisontooth.com
#### This server's hostname (in case `hostname` doesn't work)
$thishost="poisontooth.com";

Save these changes to the Majora CGI file, and the system will be ready to go. To test it, start your Web browser and open the URL where Majora has been installed. Figure 29.1 shows the Majora login screen.

29fig01.jpg

Figure 29.1 Log in to your e-mail account.

After logging in to the system, the available options Compose, Get Mail, and Logout are displayed along the right side of the browser window. Those should be reasonably self-explanatory.

Clicking Get Mail might take quite awhile, depending on the size of your inbox. After collecting information about each message, a listing will be displayed for each one, as shown in Figure 29.2. Click the number at the start of each line to read the corresponding message.

29fig02.jpg

Figure 29.2 The messages in the inbox are listed.

The Majora code is open and can be modified as you see fit. Feel free to edit the Perl code to your heart's content.

Share ThisShare This

Informit Network