Simple mail server with webmail

This guide is for getting basic mail server working in small amount of time. You can always add more features later. This guide uses postfix MTA, dovecot IMAP, POP, SASL and SquirrelMail webmail.

Postfix MTA
Install. Enable dovecot-sasl, ipv6, pam and ssl USE flags. See also the Postfix article.

If this is a new install, the previous command should uninstall. If it fails to uninstall, you need to manually uninstall it, because it blocks Postfix:

Configure Postfix.

Edit aliases to redirect root mails to webmaster:

Generate aliases database:

Redirect root mails to webmaster:

Check for errors:

Start Postfix:

Check for errors:

dovecot IMAP, POP & SASL
Install. Enable USE flags : bzip2 ipv6 maildir pam ssl zlib

Configure dovecot:

Start dovecot:

SquirrelMail webmail
Change dir to webserver root:

Unpack squirrelmail:

Configure squirrelmail:

Create data dirs and set permissions:

Debug squirrelmail by opening url: http://example.com/squirrelmail-webmail-1.4.22/src/configtest.php

You can access webmail by opening url: http://example.com/squirrelmail-webmail-1.4.22/.

Everything should be working now.

Troubleshooting
Check your error log (mine is /var/log/messages).

If you get this error and can't login to squirrelmail: "auth: Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-sql.conf.ext"

then try these changes and restart dovecot: