Email servers
This section discusses email servers. (Email clients are discussed
in the
section under
Email
):
Which email server to use?
After decades of running
sendmail, we moved to
postfix since postfix
is much easier to configure
than sendmail and its performance is very good.
Other possibilities worth checking out:
The rest of this page discusses configuring and using postfix.
Postfix configuration overview
The postfix web site is:
http://www.postfix.org.
You can download postfix package from
rpmfind
or install postfix from the Red Hat 9 CDs.
To install postfix:
rpm -iv postfix-1.1.11-5.i386.rpm
If you were previously running sendmail:
Copy over the updated
/etc/aliases file into /etc/aliases and then type:
newaliases
The main postfix configuration file is /etc/postfix/main.cf.
Edit the file. It is commented very well and tells you what to customize
for your site.
Then start postfix:
/etc/init.d/postfix start
Then make postfix automatically start every time the system boots:
chkconfig --add postfix
This command adds postfix symbolic links into the /etc/rc.d file
structure.
ntsysv
Use the down arrow key to move down to postfix
and then a space to put an asterisk next to postfix
and then a tab to get to OK then press ENTER to
save the changes.
Using Postfix
The email clients are the main ones using postfix. However, as the
postfix administrator, you may want to check on the mail quese, flush
the queues, etc.:
To delete messages from the queue:
mailq
postsuper -d message-id
Flush the queue (immediately try to send any messages in the queue):
postfix flush
Adding email access from a browser
You can add email access to your site (similar to yahoo mail which is
accessible via the web) using
Squirrel Mail.
You can get an idea of the web mail interface by looking at
screen images of squirrel mail.
The requirements for running squirrel mail are:
- Your web server must be configured to use PHP. The
default Red Hat 9 web
server has the web server configured for PHP already so
this shouldn't be a problem.
- Install the IMAP4 server from the Red Hat CDs or
through
rpmfind.
After the above is finished, the you can start installing and configuring
squirrel mail.
-
Download Squirrel mail (pick the .bz2 one since it's compressed the most).
- Uncompress and extract squirrel mail into a directory that
is accessible by the apache web server:
cd /var/www/html
mkdir squirrel
cd squirrel
bzcat squirrelmail*bz2 | tar xvf -
- Create directories to be used for attachments and user data:
mkdir -p /export/squirrel/data
mkdir -p /export/squirrel/attachments
cd /export/squirrel
chgrp -R apache attachments data
chmod 730 attachments
- Edit the config/config.php file, and set the
$data_dir and $attachment_dir to the same as the squirrel
directory:
...
$data_dir = '/export/squirrel/data/';
$attachment_dir = '/export/squirrel/attachments/';
...
- Enable file_uploads in the php.ini file:
...
file_uploads = On
...
- Create a file named /var/www/html/squirrel/.htaccess
with the following contents:
AddType application/php4script .php
Action application/php4script /cgi-bin/php
- Restart the web server so it will allow you to send mail
through the squirrel mail browser interface.
(Reading mail works fine without restarting the web server, but sending
email doesn't work until you restart the web server.)
/etc/init.d/httpd restart
- From a browser, access squirrelmail with a URL similar to:
http://yourservername/squirrelmail
Where to get more information
Linux Quick Reference Home
Linux Migration Home