This article sets out the steps needed to support multiple domains and their users’ email accounts allowing them to recieve emails via secure IMAP and send emails via a secure SMTP server using their POP3/IMAP credentials. This is particularly useful for mobile users (road warrior) who may not have a consistent ISP provided SMTP server.
- Recieve emails, using IMAPS or POP3S via Dovecot
- Configuring Postfix to receive and send emails for virtual domain, and emails accounts
- Configure SASL to provide a method of authenticating users email users to allow them access to the Postfix SMTP in order to send emails securely.
- Easy delegated management of virtual domain mailboxes using PostfixAdmin
This article has been put together from countless other articles so that it should provide an all inclusive set of instructions.
This setup is based on Ubuntu 12.04 LTS using Postfix as the Mail Transport Agent (MTA), Postfixadmin and its associated Mysql tables handling multiple virtual domain and user mailboxes. Dovecot as the method to allow IMAP(s) POP3(s) to pick up email messages, with SASL SMTP AUTH for external authenticated users being allow to send email from other networks.
In order to get this working the following additional packages are required :
To install the above issue the following command (you might have to prefix below with sudo to elevate priveledges if you are not root) :
apt-get install mysql-server mysql-client postfix postfix-mysql postfix-doc dovecot-common dovecot-mysql dovecot-imapd dovecot-pop3d libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl telnet mailutils
This will install all the neccesary packages, during the mysql-server install you will be prompted to choose a root password for MySQL, please make sure you choose a complex password preferable consisting of numbers and letters. Keep this in a safe place for future reference.
During the postfix installation, the following will be displayed, as below please select the option Internet Site and continue.
The next screen prompts you for the ‘System mail name’ this should be your fully qualified domain name (FQDN). What is this? Well this should be the domain name of your external presence on the web. Treat is as the parent domain name, it is the domain that your clients expect to administer their site e.g. myhostingcompany.com.
This completes the package installation steps. Next, its time to set up the MySQL database to handle the virtual domains and user’s email boxes.