Recipe 20.18. Squirreling Around with Webmail

 < Day Day Up > 

20.18.1 Problem

Your remote users want even more freedom, and don't want to be tied down to a mail client. So you'd like to set up web access to email.

20.18.2 Solution

Give them Squirrelmail; then they can log in from any web browser, anywhere.

Prerequisites:

  • A working IMAP server

  • PHP4

  • A working Apache web server

To install Squirrelmail simply copy the Squirrelmail files to your system. The usual location is wherever you store your other web files (e.g., /var/www/squirrelmail), though it really doesn't matter where they go. Then run Squirrelmail's configuration script:

# /usr/sbin/squirrelmail-configure

This is for setting your own preferences, such as company name, color themes, and filepaths.

Squirrelmail is simply a batch of PHP4 files, which means Apache does the real work and must be configured to support PHP4. In this example, the existing web site is www.tuxcomputing.com, as this entry in httpd.conf shows:

### Section 2: 'Main' server configuration ServerName www.tuxcomputing.com DocumentRoot /var/www

Open httpd.conf, and uncomment or create these entries:

LoadModule php4_module /usr/lib/apache/1.3/libphp4.so     # make sure index.php is included <IfModule mod_dir.c>   DirectoryIndex index.html index.htm index.shtml index.cgi index.php </IfModule       AddType application/x-httpd-php .php   AddType application/x-httpd-php-source .phps

Save your changes and restart Apache.

Next, create a soft link named /var/www/webmail to /usr/share/squirrelmail, or wherever your Squirrelmail directory is:

# ln -s /usr/share/squirrelmail  /var/www/webmail

Now users can log in to their webmail at http://www.tuxcomputing.com/webmail.

20.18.3 Discussion

Squirrelmail is a PHP4 interface to Apache, not a standalone application. You'll need Apache knowledge.

As of this writing, there were still issues with PHP4 on Apache 2.x, so until those are resolved, Apache 1.3 is recommended.

If you want to enable http://webmail.tuxcomputing.com, instead of http://www.tuxcomputing.com/webmail, you'll need a DNS entry pointing to it, and you'll have to create a VirtualHost entry in httpd.conf. This example uses a name-based virtual host:

"NameVirtualHost *:80 <VirtualHost *:80>   ServerName webmail.tuxcomputing.net   DocumentRoot /var/www/webmail </VirtualHost>

20.18.4 See Also

  • Local Squirrelmail documentation (/usr/share/doc/squirrelmail)

  • Squirrelmail home page (http://www.squirrelmail.org)

  • Chapter 22

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net