Mail Server Setup


  1. Ubuntu 18.04 Server DO Droplet 1GB
  2. Postfix
  3. Dovecot
  4. SpamAssasin

Installing and configuring POSTFIX


$ sudo apt DEBIAN_PRIORITY=low install postfix

while installing the configuration prompt will appear. Lets just go with the following settings.

  • General type of mail configuration?: Internet Site
  • System mail name:
  • Root and postmaster mail recipient: ragulkanth
  • Other destinations to accept mail for: $myhostname,,, localhost
  • Force synchronous updates on mail queue?: No
  • Local networks: [::ffff:]/104 [::1]/128
  • Mailbox size limit: 0
  • Local address extension character: +
  • Internet protocols to use: all

To reconfigure postfix

$ sudo dpkg-reconfigure postfix

To store the emails we use Maildir format in which all the incoming and outgoing mails are stored in separate files and folders.

$ sudo postconf -e 'home_mailbox= Maildir/'

Setting the location for virtual_alias_maps table which maps the arbitrary mail accounts to linux user accounts.

$ sudo postconf -e 'virtual_alias_maps= hash:/etc/postfix/virtual'

Mapping the mail accounts to linux user accounts. For that we need to edit the file /etc/postfix/virtual.	ragulkanth	manimaran	prasanna

To make the above maps take effect

$ sudo postmap /etc/postfix/virtual

Now have to restart postfix

$ sudo systemctl restart postfix