MAIL SERVER WITH POSTFIX & DOVECOT
STEP 1• INSTALL POSTFIX
install postfix*
start postfix
enable postfix
STEP 2• Make postfix as default MTA for your system using the following command:
#alternatives --set mta /usr/sbin/postfix
If above command not work and you get the output as “/usr/sbin/postfix has not been configured
as an alternative for mta“. Use below command to do the same else skip it
#alternatives --set mta /usr/sbin/sendmail.postfix
STEP3 – Configure Postfix
Edit Postfix configuration file /etc/postfix/main.cf in your favorite editor and make following
changes.
OBS: search in the configuration file the right line, uncomment it, and make the rigth changes.
myhostname = mailserver.turkya.com
mydomain = turkya.net
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8, 192.168.10.0/24
home_mailbox = Maildir/
Step 3 – Restart Postfix Service
STEP 4 : STOP FIREWALL
STEP 5: INSTALL DOVECOT
install dovecot*
start dovecot
enable dovecot
STEP 6: Configuring Dovecot
The main configuration file is located at /etc/dovecot/dovecot.conf.
There we will cover two configurations : listen, protocols
The listen configuration option sets the IP addresses where you want the service to listen.
Usually, you use an asterisk (*) here as your value, which is a wildcard meaning all IPv4
addresses. For IPv6 addresses, you would use a double colon (::). Here's how to add both:
listen = *, ::
protocols
The protocols configuration option allows you to specify which protocols you would like to
support, such as IMAP and POP3.
Usually, LMTP is listed here as well, which stands for the Local Mail Transfer Protocol:
protocols = imap, pop3, lmtp
Next, edit below configuration file and set the username and group name of the mail server is
running with.
#sudo vim /etc/dovecot/conf.d/10-master.conf
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
Finally edit Dovecot SSL configuration file. Set SSL to yes or required. By default it uses self
singed certificate, if you have your own certificates update them as followings.
# vim /etc/dovecot/conf.d/10-ssl.conf
ssl = yes
ssl_cert =
THE SERVICES