A consumer-grade mail server is a big project. It involves a lot many packages, working together to deliver desired features.
For every needs we have multiple choice. So to make mailserver setup & management easy, we try to use same packages for all client servers.
Packages:
Below is list of package used and features they provide.
- Postfix – mail transfer agent (MTA). It sends mail from your server and also processes incoming email. When I reply to your comments on this blog, you get email notifications because of postfix.
- Dovecot – it provides imap/pop3 using which your mail client reads emails from the server. It also handles authentication (using mysql) and provides basic security and other mail-management related services.
- MySql – is used to store list of domains, virtual users/password, mail aliases, etc. Dovecot will use mysql-database to authenticate users.
- ViMbAdmin – mailbox administration web-interface to add/remove domains and mail users. This is an alternative to postfixadmin (in case you are aware of postfixadmin).
- Amavis – is a content-filter which checks email for spam & viruses using other packages.
- ClamAV – a free antivirus for linux. Its virus database is updated frequently. Please note that antivirus increases CPU load significantly.
- Spamassassin – is a spam filter. Spamassassin can learn automatically about spam on your server but as far as I know it currently doesn’t have any provision for user-specific spam preference.
- Sieve – is a mail filtering language. It is used to provide Gmail-style filters. A practical use case is – spamassassin can “mark” a mail spam but it gets delivered to Inbox only (or rejected). Its sieve filters (mostly global), which checks spamassassin’s “marking” and “move” mails from Inbox to Spam (or Junk) folder.
- RoundCube – webmail interface for mail-users. They can login using email-id and password. We will also add sieve plugin for RoundCube so users can create Gmail-like filters for their own use.
- Nginx – webserver for ViMbAdmin and RoundCube. As of now no special features of Nginx are used. We use nginx because we already have it on most of our server.
Above are main packages we are dealing with. These packages in turn needs many other packages.
Also, for amavis uses/handles spamassassin and sieve behind the scene so for basic functionality, you don’t have to worry about them.
Conventions:
Web-interface for ViMbaAdmin and RoundCube is delivered can be access using URLs like below:
Subdomain setup
- vma.example.com – ViMbaAdmin (virtual mail admin)
- mail.example.com – webmail interface for users (tribute to mail.google.com i.e. gmail.com)
Subdir setup
- example.com/vma – ViMbaAdmin (virtual mail admin)
- example.com/mail – webmail interface for users (tribute to mail.google.com i.e. gmail.com)
In both kind of setup’s nginx config will make use of alias directive.