POSTFIX PART 3 – Installing and Configuring Dovecot


PART 3 – Installing and Configuring Dovecot


Step 1: Use this command to install Dovecot

apt-get install dovecot-imapd dovecot-pop3d

When we are done installing, we will get a screen similar to the following


Step 2: Configure mailbox by editing the file

vi /etc/dovecot/conf.d/10-mail.conf

Type :set nu

Type :30 to go to line 30. You will see this line:

mail_location = mbox:~/mail:INBOX=/var/mail/%u

Replace that line with this line:

Type ESC, :x to save and exit.

Step 3: Edit the file /etc/dovecot/conf.d/20-pop3.conf to change the pop3_uidl_format.

Type :set nu to turn on line number.

Type :50 to go to line 50

Ensure the following line is uncommented:

pop3_uidl_format = %08Xu%08Xv

Step 4: Enable SSL support. Open the file

vi /etc/dovecot/conf.d/10-ssl.conf

Type :set nu to turn on line number

Type :6 to go to line number 6.

Ensure that the following line is uncommented

ssl = yes

Step 5: Restart Dovecot service

service dovecot restart

Step 6: Test IMAP and POP3 access using telnet.

To test IMAP, type telnet 143 (where 143 is the port that IMAP listens at).

To test POP3, type telnet 110 (where 110 is the port that POP3 listens at).

Also test secure IMAP and POP access on both 993 and 995.

Type quit and test port 995

Additionally, we can check listening ports using the netstat command. Type

netstat –nl4

Step 7: Create two users to test.

useradd -m jorge -s /sbin/nologin

passwd jorge

Enter a password for the user jorge.

useradd -m mike -s /sbin/nologin

passwd mike

Also enter a password for Mike.

Step 19: MX Record

Use nslookup to verify that you have MX records in place. Note in the below that the HIGHEST priority MX record is pointing to This is done on any computer on the Internet.

And of course, points to our own Postfix server that we are configuring.

In Windows 10 Technical Preview, Open Control Panel. Choose Mail.

Click Show Profiles

Click Add to add a new profile for testing purpose.

Enter the name of the profile and click OK.

Click Manually configure server settings or additional server type and click Next.

Choose Internet Email and click Next.

Fill in the information and click More Settings…

Outgoing Server

Click Test account Settings

Click Yes to continue using this server.

Click Close

Click Next.

Click Close

Click Finish.

Set the profile to use so that every time when we launch Outlook, the test profile opens.

Launch Outlook. You will see the mailbox opens.

Compose an email to send out to the Internet. Hit Send when done.

Check the Sent Item to ensure that the mail has been sent.

In Gmail, we see that email shown up in the inbox.

In Gmail, Reply to the email and verify that I also received it in Jorge’s inbox.

So we have verified that incoming and outgoing Internet mail is flowing. Should you want to bring this server in live environments, please remember to make sure that you have security measures in place for it such as Anti-Virus and Antispam firewall and services to protect it from misuse.