Setup Mail Server on Ubuntu 9.04 with Postfix+Dovecot+SASL

I. INTRODUCTION

To setup an email server is complete, we will need the following components:

  • SMTP Server, can use Postfix, Qmail and Sendmail. We will use Postfix
  • POP3 Server, can use UW-IMAP, Courier or Dovecot. We will be using Dovecot
  • Fetch Mail, to pull emails from the outside to the local server
  • IMAP Server, can use Squirellmail or roundcube

To equate the assumption of the installation I’m doing here I use the following data, so please sesusaikan with your data:

  • Name of host: mailserver
  • Host Ip address: 10.14.20.5/24
  • Domain: udiniq.com
  • FQDN (/ etc / hosts):10.14.20.5 mail.udiniq.com mailserver

II. INSTALLATION PROCESS

1. Install Postfix MTA (Mail Transfer Agent)

To perform the installation of postfix on ubuntu please do the following:

root @ mailserver:~# aptitude update && aptitude install postfix postfix-tls libsasl2-2 sasl2-bin libsasl2-modules

Usually when the download and installation is complete, the installation will provide questions for postfix configuration in ubuntu,please adjust the following data:

  • General type of mail configuration: Internet Site
  • System mail name: udiniq.com
  • Root and postmaster mail recipient :
  • Other destinations for mail: chemco.co.id, localhost.chemco.co.id,, localhost_
  • Force synchronous updates on mail queue?: No
  • Local networks: 127.0.0.0 / 8, 10.14.20.0/24
  • Mailbox size limit (bytes): 0
  • Local address extension character: +
  • Internet protocols to use: all

Next enter the command to restart postfix:

root@mailserver:~# /etc/init.d/postfix restart

Perform tests via the console with the command telnet localhost 25. If a response means that the installation was OK:

root@mailserver:~# telnet localhost 25

Trying:: 1 …
Connected to localhost.
Escape character is’^]’.
220 chemco.co.id ESMTP Postfix (Ubuntu)

To unsubscribe please type quit and Enter

2. Install Dovecot for POP3

To install dovecot on ubuntu please do the following:

root@mailserver:~# apt-get install dovecot-imapd dovecot-pop3d dovecot-common

Then please edit the file dovecot fit our needs, which dovecot file is located in /etc/dovecot/dovecot.conf:

root@mailserver:~# vim /etc/dovecot/dovecot.conf

–- At certain points please adjust the following data: –-

protocols = imap imaps pop3 pop3s please change to:

# Protocols = imap imaps pop3 pop3s
protocols = pop3 imap
# Disable_plaintext_auth = yes change to:
disable_plaintext_auth = no
## Do not forget to section specific POP3 settings for pop3_uidl_format =% 08Xu% 08Xv must uncomment

- -Save with Esc: wq and Enter –

Perform tests via the console with the command telnet localhost 110 If a response means that the installation was OK:

root @ mailserver:~# telnet localhost 110

Trying:: 1 …
Trying 127.0.0.1 …
Connected to localhost.
Escape character is’^]’.
+ OK Dovecot ready.

To unsubscribe please type quit and Enter

3. Configuring SASL with TLS Authentication

To configure SASL with TLS please do the following steps:

root@mailserver:~# vim /etc/postfix/main.cf

- -Please enter the following script section at the bottom –

smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = udiniq.com
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_security_options = noanonymous
inet_protocols = all

– Save with esc :wq and Enter –

Furthermore, the following command:

root@mailserver:~# rm -r /var/run/saslauthd/
root@mailserver:~# mkdir -p /var/spool/postfix/var/run/saslauthd
root@mailserver:~# ln -s /var/spool/postfix/var/run/saslauthd /var/run
root@mailserver:~# chgrp sasl /var/spool/postfix/var/run/saslauthd
root@mailserver:~# adduser postfix sasl

Furthermore, the following command:

root@mailserver:~# vim /etc/dovecot/dovecote.conf

- -At certain points please adjust the following data: –

auth default2 {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
}

– Save with esc :wq and enter –

configuration that runs well please restart the mail server, the command :

root@mailserver:~# reboot

For create an email account on the mail server, such steps in the manufacture of users on Linux servers.

finally the installation of mail servers with Postfix + Dovecot + SASL is complete, but the installation is not included with the webmail client, and if you want to add it please read the guide at:

Webmail client with squirrelmail, please read HERE
Webmail client with roundcube, please read HERE

Publish on February 4th, 2012 under Ubuntu by udiniq | No Comments »

Berikan Komentar Anda

= 0+6 (Wajib dijumlahkan)