Building A Reliable Open Source Mail Server for Fedora Core 3

*UPDATED 11/12/04 for Fedora Core 3

This tutorial is one of many available on the Internet. The focus here is on ease of implementation, avoidance of heavy customization (compiling from source, long config files), and software manageability (all RPM based).

This turtorial is the *QUICK* version of previous versions. All software downloading, compiling, and installing is automated via a series of very simple helper scripts. These scripts are specific to the  package distributions below and must be edited to accomodate new software revisions.


o no licenses
o open source GNU software
o secure online interface using SSL
o minimal hardware requirements
o server side Spam filtering

Bundled Distribution Software Requirements
o Fedora Core 3 with the following packages:
    o Apache
    o PHP
    o Postfix
    o wget
Unbundled Software Requirements
o Apt 0.5.15 (
o Courier IMAP 3.0.8 (
o Maildrop 1.7.0 (
o SpamAssassin 3.0.8 (
o perl-Mail-Spamassassin 3.0.8 (
o Anomy Mail Tools 1.69 (
o Subjadd (
o Squirrelmail 1.4.3a (

Remove if already installed
o SpamAssassin
o perl-Mail-Spamassassin

Software Not Used
o MySQL, PostgreSQL

Account Management and Mailboxes
o standard user accounts via the /etc/passwd and /etc/shadow files

Examples used in this tutorial need to be replaced with the relevant values

1. Download and Install the APT Package Manager for RPM from 

This package manager ensures easy installation of any needed software and is much faster than up2date/Fedora mirrors.

$ su -
# wget
# wget
# rpm -ivh apt*
2) Create a user called "rpmbuild" for building packages. 
# useradd -d /home/rpmbuild -m rpmbuild
3) Download the RPM install scripts to the rpmbuild user's home directory.
# cd /home/rpmbuild
# wget
# tar zxvf open-source-mail.tar.gz
4) Install the RPM development dependencies for all of the RPMS that will be created.
# ./
5) As the user "rpmbuild", create the binary RPM packages.
# su - rpmbuild
$ ./
6) As root, install the packages and configuration templates. 
# ./
# ./
7) Configure Postfix and integrate maildrop.
# vi /etc/postfix/
myhostname =
mydomain =
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain
home_mailbox = Maildir/
mailbox_command = /usr/bin/maildrop -d "$USER" -f "$SENDER" "$EXTENSION"

# chkconfig postfix on
# service postfix start
8) Install and configure Squirrelmail for Courier IMAP

# cd /usr/share/squirrelmail/conf
# ./


D. Set pre-defined settings for specific IMAP servers

Command >> D
SquirrelMail Configuration : Read: config.php


Please select your IMAP server:
cyrus = Cyrus IMAP server
uw = University of Washington's IMAP server
exchange = Microsoft Exchange IMAP server
courier = Courier IMAP server
macosx = Mac OS X Mailserver
quit = Do not change anything
Command >> courier

imap_server_type = courier
default_folder_prefix = INBOX.
trash_folder = Trash
sent_folder = Sent
draft_folder = Drafts
show_prefix_option = false
default_sub_of_inbox = false
show_contain_subfolders_option = false
optional_delimiter = .
delete_folder = true

Press any key to continue...


Command >> S

Data saved in config.php
Press enter to continue...


Command >> q
9. Configure Apache

This is a very basic configuration of an Apache webserver using "name based" virtual hosting. These variables are the ONLY
 ones that need to be changed.

# vi /etc/httpd/conf/httpd.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/html/example
ErrorLog logs/error_log
CustomLog logs/access_log common

# mkdir /var/www/html/example
# mkdir /var/www/html/example/logs
# touch /var/www/html/example/logs/access_log
# touch /var/www/html/example/logs/error_log
# chown -R apache:apache /var/www/html/example/logs/
10. Create a user with the /usr/bin/add_user script.
# add_user jdoe
Setting up the user jdoe...

Is 502 okay? [y or n]: y
The UID 502 will be used for user jdoe.
Use default group? [y or n]: y
The group jdoe will be used with UID jdoe
Would you like to use the default home directory of /home/jdoe? [y or n]: y
The home directory of /home/jdoe will be used for UID jdoe.

Available  Email Domains

1) localhost
Pick an email domain []:
The domain was selected.
Would you like to setup an email alias [y or n]? y
Enter alias: johnny.doe
The alias will be added /to/etc/aliases.

Here are your settings.

Home dir: /home/jdoe
Group: jdoe
UID: 502
Email Alias: johnny.doe
Are these choices okay? [y or n]: y
User jdoe setup
Changing password for user jdoe.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
Adding aliaes...

Setting up Squirrelmail...
USER jdoe is setup...

11) Logining into Squirrelmail

Point your web browser to

You should be at the Squirrelmail login page. Enter a valid Unix user account and pass. Each user needs to subscribe to both their Spam and Virus folders. This can be done by clicking on "Folders" at the top, selecting both the Spam and Virus folders at the bottom of the page, and clicking on "Subscribe".

12) Debug Messages

An approrpiately delivered message should log this entry:

# tail -f /var/log/maillog
Mar 17 21:44:09 asaph postfix/smtpd[30781]: connect from[]
Mar 17 21:44:10 asaph postfix/smtpd[30781]: 600E33A7F3:[]
Mar 17 21:44:10 asaph postfix/cleanup[30783]: 600E33A7F3: message-id=<2050.
Mar 17 21:44:10 asaph postfix/smtpd[30781]: disconnect from[]
Mar 17 21:44:10 asaph postfix/nqmgr[30707]: 600E33A7F3: from=<>, size=1009,
 nrcpt=1 (queue active)
Mar 17 21:44:10 asaph spamd[30274]: connection from asaph [] at port 32906
Mar 17 21:44:11 asaph spamd[30788]: info: setuid to darren succeeded
Mar 17 21:44:11 asaph spamd[30788]: Creating default_prefs [/home/testuser/.spamassassin/user_prefs]
Mar 17 21:44:11 asaph spamd[30788]: Created user preferences file: /home/testuser/.spamassassin/user_prefs
Mar 17 21:44:11 asaph spamd[30788]: processing message <2050.>
for darren:500.
Mar 17 21:48:26 asaph postfix/local[30814]: B0F7C3B1F7: to=<>, relay=local, delay=1,
status=sent ("|/usr/bin/maildrop -d "$USER" -f "$SENDER" "$EXTENSION")

Links and References:

Thanks to Robin Whittle ( for great documentation on all of this!