Squirrelmail is a popular webmail interface. It works with any IMAP server, and is stable enough that it is included as a standard package in most Linux distributions.
Some qmail install guides (notably qmailrocks) are telling people to configure Squirrelmail so that it uses SMTP AUTH when sending outbound mail, regardless of how the server is otherwise set up. While this can be a good idea in some cases, if they are both on the same machine it may not be necessary- and unless you have a real need for messages originating from the webmail interface to be processed through the SMTP server it actually wastes CPU cycles to force the messages through the SMTP server.
For systems where Squirrelmail and the SMTP server are on the same machine, it may be better to configure Squirrelmail to use "sendmail" for outgoing mail, rather than using SMTP. By "sendmail" I am not talking specifically about the old sendmail mail server program. All of my servers run qmail. By "sendmail" I am referring to the Squirrelmail configuration option "Sendmail or SMTP".
This page shows how to configure Squirrelmail to use a command-line program to send outbound mail, rather than using SMTP to connect to a server in order to send outbound mail.
Many SMTP servers scan incoming messages for viruses and spam. The chances of somebody manually typing (or copying and pasting) a virus into a webmail window are rather small, but you may occasionally run into a "user" who gets access to your webmail system and uses it to send spam. By having the webmail interface send all outbound messages through your SMTP server, your anti-spam filters would catch such a person and prevent their spam from getting out.
Some companies may also be keeping copies of all inbound and outbound email- and if the monitoring is being done at the SMTP level (which is not a very good way to do it, but people will do the strangest things sometimes) then you would need the mail to go through the SMTP server as well.
This solution (allowing Squirrelmail to use a command line program to send mail rather than using SMTP) may or may not be a good solution for your server- only you can make that decision. This page simply explains how to configure Squirrelmail if you do decide to go with the non-SMTP solution.
2008-03-17 Another option would be to set up a virus and/or spam scanner for qmail-inject (which is called by the "sendmail" wrapper program) using the same "glue" program (simscan, qmail-scanner, etc.) you would use for qmail-smtpd. This can be done by creating a QMAILQUEUE environment variable, since qmail-inject uses the same QMAILQUEUE variable that qmail-smtpd does.
Before we can re-configure qmail, there are a few pieces of information you will need:
The location of your sendmail binary. If you are running the
old "sendmail" program, this will be /usr/sbin/sendmail
. If
you are running qmail, this will probably be
/var/qmail/bin/sendmail
, although
/usr/sbin/sendmail
may exist as a symbolic link to
/var/qmail/bin/sendmail
. If so, you can use either name,
although on my own server I use the /var/qmail/bin/sendmail
name directly, to make it obvious that qmail is being used.
The location of your Squirrelmail directory. Every installation of Squirrelmail revolves around a single directory which contains the PHP code, images, plugins, themes, and configuration information for Squirrelmail. You should already know where this is- if not, you can get the location from the httpd.conf file on your server. There is normally a line which looks like this:
Alias /squirrelmail /usr/share/squirrelmail
Within the indicated directory will be a config
directory,
and in that directory will be a script called conf.pl
. This
script is used to configure Squirrelmail.
The following shows how to run the configuration script:
As root...
# cd /usr/share/squirrelmail/config
# ./conf.pl
You will see a menu on the screen which looks like this:
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books (LDAP)
7. Message of the Day (MOTD)
8. Plugins
9. Database
D. Set pre-defined settings for specific IMAP servers
C. Turn color off
S Save data
Q Quit
Command >>
You will need to make the following choices from the menus. As you choose each item, you will see a new menu. Each successive choice on this list is an option on the menu which appears
2. Server Settings
3. Sendmail or SMTP
1. Sendmail
B. Change Sendmail Config
4. Sendmail Path
Enter the full path to your sendmail binary. For example, on a qmail
system, enter /var/qmail/bin/sendmail
.
S Save data
Q Quit
You may need to restart Apache after making these changes.
Once you have changed these settings, any time a Squirrelmail user sends an outgoing message, it will be sent using the sendmail binary rather than the SMTP server.