Postfix is popular open source mail transfer agent which runs on most of Unix like OS. It comes with a lot no. of parameters, most of them carry default values. Small updations to these in considering with your environment specific will make your mail server up and running in no time.
The following sections will help you out in installing and configuring postfix on ubuntu box :
1.1 Installation
With the help of package manager we can fetch all the dependencies packages and install them.
1apt-get install postfix
1.2 Configuration
Postfix ships with configuration file main.cf. Your configuration file should look like below
1smtpd_banner = $myhostname ESMTP2biff = no3append_dot_mydomain = no4readme_directory = no5##SSL Conf6smtpd_tls_cert_file = /etc/postfix/ssl/server.crt7smtpd_tls_key_file = /etc/postfix/ssl/server.key8smtpd_use_tls = yes9smtpd_tls_security_level = may10smtpd_tls_loglevel = 111smtpd_sasl_auth_enable = yes12smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd13###Domain Conf14myhostname = mail.example.com15alias_maps = hash:/etc/aliases16alias_database = hash:/etc/aliases17myorigin = /etc/mailname18mydestination = smtp_uat.example.com, example.com, smtp_uat,localhost.localdomain, localhost19mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/12820mailbox_size_limit = 021recipient_delimiter = +22inet_interfaces = all23smtpd_sasl_type = dovecot24smtpd_sasl_path = private/auth25smtpd_sasl_auth_enable = yes
Finally, make an entry in /etc/mailname for your domain
email.example.com
Dovecot
2.1 Installation
Use package manager to install dovecot
apt-get install dovecot-core dovecot-imapd dovecot-pop3d,dovecot-common
2.2 Configuration
Update your dovecot.conf as below
1disable_plaintext_auth = yes2mail_privileged_group = mail3mail_location = mbox:~/mail:INBOX=/var/mail/%u4userdb {5driver = passwd6}7passdb {8args = %s9driver = pam10}11protocols = imap pop312service auth {13unix_listener /var/spool/postfix/private/auth {14group = postfix15mode = 066016user = postfix17}182.3 Create User and home directory1920Execute following commands in shell to create user and home directory2122#useradd example_user.com -d /home/example_user.com -s /bin/nologin23#cd /home && mkdir example_user.com24#chown -R example_user.com:example_user.com example_user.com/25#passwd example_user.com
2.4 Inbox Location
Inbox location for user is /var/mail/example_user
Note : Here you will see all incoming mails information



