You are on page 1of 20

How to setup mail server in centos 6

( postfix-dovecot )

This article describes how to setup a mail server in centos 6 . Here i have used three popular
packages which is very easy to configure .
» Postfix ( for sending )
» Dovecot ( for receiving )
» Squirrelmail ( for webmail access )
This guide is strictly for learning purpose , not for real time servers .
Let’s start

Setup mail server in centos 6


» Installing and configuring postfix
» Installing and configuring dovecot
» Creating users and testing
» Installing and configuring squirrelmail
» Installing and configuring postfix

Step 1 »Before installation assign a static ip and add a host entry for your domain to that
IP in the /etc/hosts file like below.

10.1.125.5 mail.ditfrek.postel.go.id

Step 2 » Issue the below command to install postfix

[root@mail ~]# yum -y install postfix

Step 3 » Now issue the below command to install SMTP AUTH packages .

[root@mail ~]# yum -y install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-md5


cyrus-sasl-plain
Postfix package installation is completed .

Step 4 » Issue the below commands one by one for creating SSL Cert.
[root@mail ~]# mkdir /etc/postfix/ssl
[root@mail ~]# cd /etc/postfix/ssl/
[root@mail ssl]# openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
[root@mail ssl]# chmod 600 smtpd.key
[root@mail ssl]# openssl req -new -key smtpd.key -out smtpd.csr
[root@mail ssl]# openssl x509 -req -days 365 -in smtpd.csr -signkey smtpd.key -out smtpd.crt
[root@mail ssl]# openssl rsa -in smtpd.key -out smtpd.key.unencrypted
[root@mail ssl]# mv -f smtpd.key.unencrypted smtpd.key
[root@mail ssl]# openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem
-days 365

Step 4 » Now open /etc/postfix/main.cf file .


Find and comment the below lines .
#inet_interfaces = localhost #---> line no 116
#mydestination = $myhostname, localhost.$mydomain, localhost #--> line no 164

and add these lines at the bottom of the file.


#################################

# KONFIGURASI TAMBAHAN

# TAUFIK.RAHMAN@SIGMA.CO.ID

#################################

myhostname = mail.ditfrek.postel.go.id

#mydomain = mail.ditfrek.postel.go.id

mydestination =

mynetworks = 10.1.125.0/24 , 127.0.0.0/8 , 209.85.160.0/24, 10.1.126.0/24

inet_interfaces = all

message_size_limit = 50720000

virtual_alias_domains =

virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-


virtual_email2email.cf

virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf

virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf

virtual_mailbox_base = /home/vmail

virtual_uid_maps = static:5000

virtual_gid_maps = static:5000

smtpd_sasl_type = dovecot

smtpd_sasl_path = private/auth

smtpd_sasl_auth_enable = yes

broken_sasl_auth_clients = yes

smtpd_sasl_authenticated_header = yes

smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated ,defer_unauth_destination

smtpd_use_tls = yes

smtpd_tls_key_file = /etc/postfix/ssl/server.key

smtpd_tls_cert_file = /etc/postfix/ssl/server.crt
#smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem

#smtpd_tls_cert_file = </etc/pki/dovecot/certs/dovecot.pem

#smtpd_tls_key_file = </etc/pki/dovecot/private/dovecot.pem

virtual_create_maildirsize = yes

virtual_maildir_extended = yes

#proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains


$virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains
$canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps
$transport_maps $mynetworks $virtual_mailbox_limit_maps

proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains


$virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains
$canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps
$transport_maps $mynetworks $virtual_mailbox_limit_maps

virtual_transport = dovecot

dovecot_destination_recipient_limit = 1

debug_peer_level = 5

debug_peer_list = 127.0.0.1

Step 5 » Now open /etc/postfix/master.cf file and add the below line after smtp

smtps inet n - n - - smtpd


-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_sender=yes
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o broken_sasl_auth_clients=yes

smtps inet n - n - - smtpd


-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_sender=yes
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o broken_sasl_auth_clients=yes

Step 6 » Now start postfix and saslauthd service


[root@mail ~]# service postfix start

[root@mail ~]# service saslauthd start

» Issue the below commands to start the postfix and saslauthd at startup
[root@mail ~]# chkconfig --level 235 postfix on

[root@mail ~]# chkconfig --level 235 saslauthd on

Step 7 » Now check your smtp connectivity . just telnet localhost on port 25 and type this
command ehlo localhost

[root@mail ~]# telnet localhost 25


Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mail.ditfek.postel.go.id ESMTP Postfix
ehlo localhost <---- type this command
250-mail.ditfek.postel.go.id
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.

If you get this output .. Great .. everything is fine till now.

» Installing and configuring dovecot

Step 8 » Issue this command to install dovecot


[root@mail ~]# yum -y install dovecot

Step 9 » After installation open /etc/dovecot/dovecot.conf file and add the below line at
the end of the file. please make sure mail_location and home_mailbox in postfix
configuration are using the same name.
protocols = imap pop3
mail_location = maildir:~/mail
pop3_uidl_format = %08Xu%08Xv

Step 10 » Now start dovecot service


[root@mail ~]# service dovecot start

» Issue the below command to start the dovecot at startup


[root@mail ~]# chkconfig --level 235 dovecot on

Step 11 » Now test your pop3 connectivity .


[root@mail ~]# telnet localhost 110
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
quit
+OK Logging out
Connection closed by foreign host.

Yes .. your server is ready to receive mails .

» Creating users and testing

Step 11 » Now create users to test your configuration.


[root@mail ~]# useradd -m bobby -s /sbin/nologin

[root@mail ~]# useradd -m leela -s /sbin/nologin

and create passwords for the users created


[root@mail ~]# passwd bobby

[root@mail ~]# passwd leela

Step 12 » Test your configuration in thunderbird . Refer the below image for
configuration details.
Mail server centos 6 testing

Step 13 » Now you can send and receive mails using this server. In case of any issues
please check the log file /var/log/maillog )

your mail server is ready …

» Installing and configuring squirrelmail


Step 14 » you need to add EPEL repository to install squirrelmail package. you can find
latest EPEL repository rpm here
( http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/repoview/epel-release.html )

[root@mail ~]# rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-


8.noarch.rpm

Step 15 » Issue the below command to install squirrelmail.


[root@mail ~]# yum install squirrelmail

This command will install squirrelmail along with apache and php.

Step 16 » Now run the below command to configure squirrelmail .


[root@mail ~]# perl /usr/share/squirrelmail/config/conf.pl

»»» 1 »»» 1 »»» krizna (type Organization name ) »»» R ( return )


»»» 2 »»» 1 »»» ( hit space for empty Domain name ) and choose 3 »»» SMTP ( choose
SMTP ) »»» R ( return )
»»» D »»» dovecot ( type ) »»» press enter with default
»»» s ( save and quit)

Step 17 » Open /etc/httpd/conf.d/squirrelmail.conf file and uncomment below lines


# RewriteCond %{HTTPS} !=on
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Step 18 » start apache service


[root@mail ~]# service httpd start

» Issue the below commands to start the httpd at startup


[root@mail ~]# chkconfig --level 235 httpd on

Step 19 » Now open http://serverip/webmail path in your browser . you could able to see
the below page .
setup mail server postfix-dovecot-squirrelmail
and after login
setup mail server postfix-dovecot-squirrelmail

Email with Postfix, Dovecot and MySQL on


CentOS 6
Updated Thursday, March 26th, 2015 by Elle Krout
The Postfix Mail Transfer Agent (MTA) is a high performance open source e-mail server
system. This guide will help you get Postfix running on your CentOS 6 Linode, using
Dovecot for IMAP/POP3 service, and MySQL to store information on virtual domains
and users.
Prior to using this guide, be sure you have followed the getting started guide and set
your hostname.
The steps in this guide require root privileges. Be sure to run the steps below as  root ,
or use  su - root  to log in as root. Certain commands below cannot be run as  sudo  and
must be run as root.
Install Required Packages
1. Install any outstanding package updates:

yum update
1

2. The version of Postfix included in the main CentOS repository does not include
support for MySQL; therefore, you will need install Postfix from the CentOS Plus
repository. Before doing so, add exclusions to
the  [base]  and  [updates]  repositories for the Postfix package to prevent it from
being overwritten with updates that do not have MySQL support:
/etc/yum.repos.d/CentOS-Base.repo

[base]
1 name=CentOS-$releasever - Base
2 exclude=postfix
3
4 #released updates
5 [updates]
6 name=CentOS-$releasever - Updates
7 exclude=postfix
8

3. Install the required packages:


yum --enablerepo=centosplus install postfix
1 yum install dovecot mysql-server dovecot-mysql
2

4. This installs the Postfix mail server, the MySQL database server, the Dovecot
IMAP and POP daemons, and several supporting packages that provide services
related to authentication.
Next, set up a MySQL database to handle virtual domains and users.

Set up MySQL for Virtual Domains and Users


1. Configure MySQL to start on boot, then start MySQL:

chkconfig mysqld on
1 service mysqld start
2

2. Run  mysql_secure_installation . You will be presented with the opportunity to change the
MySQL root password, remove anonymous user accounts, disable root logins outside of
localhost, remove test databases, and reload privilege tables. It is recommended that you
answer yes to these options:
mysql_secure_installation
1

3. Start the MySQL shell:

mysql -u root -p
1

4. Create a database for your mail server and switch to it:

CREATE DATABASE mail;


1 USE mail;
2

5. Create a mail administration user called  mail_admin  and grant it permissions on


the  mail database. Please be sure to replace  mail_admin_password  with a strong
password:
1 GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO
2 'mail_admin'@'localhost' IDENTIFIED BY 'mail_admin_password';
3 GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO
'mail_admin'@'localhost.localdomain' IDENTIFIED BY 'mail_admin_password';
FLUSH PRIVILEGES;

6. Create the virtual domains table:

CREATE TABLE domains (domain varchar(50) NOT NULL, PRIMARY KEY


1 (domain) );

7. Create a table to handle mail forwarding:

CREATE TABLE forwardings (source varchar(80) NOT NULL, destination TEXT


1 NOT NULL, PRIMARY KEY (source) );

8. Create the users table:

CREATE TABLE users (email varchar(80) NOT NULL, password varchar(20) NOT
1 NULL, PRIMARY KEY (email) );

9. Create a transports table:

CREATE TABLE transport ( domain varchar(128) NOT NULL default '',


1 transport varchar(128) NOT NULL default '', UNIQUE KEY domain (domain) );

10. Exit the MySQL shell:

quit
1

11. Bind MySQL to localhost (127.0.0.1) by editing  /etc/my.cnf , and adding the
following to the [mysqld]  section of the file:
/etc/my.cnf

bind-address=127.0.0.1
1

This is required for Postfix to be able to communicate with the database server. If
you have MySQL set up to listen on another IP address (such as an internal IP),
you will need to substitute this IP address in place of  127.0.0.1  during the Postfix
configuration steps. It is notadvisable to run MySQL on a publicly-accessible IP
address.
12. Restart the database server:

service mysqld restart


1

Next, perform additional Postfix configuration to set up communication with the


database.

Configure Postfix to work with MySQL


For the next four steps, replace  mail_admin_password  with the  mail_admin  password
input earlier.
1. Create a virtual domain configuration file for Postfix called  /etc/postfix/mysql-
virtual_domains.cf :
/etc/postfix/mysql-virtual_domains.cf

user = mail_admin
1 password = mail_admin_password
2 dbname = mail
3 query = SELECT domain AS virtual FROM domains WHERE domain='%s'
4 hosts = 127.0.0.1
5

2. Create a virtual forwarding file for Postfix called  /etc/postfix/mysql-


virtual_forwardings.cf :
/etc/postfix/mysql-virtual_forwardings.cf

user = mail_admin
1 password = mail_admin_password
2 dbname = mail
3 query = SELECT destination FROM forwardings WHERE source='%s'
4 hosts = 127.0.0.1
5

3. Create a virtual mailbox configuration file for Postfix called /etc/postfix/mysql-


virtual_mailboxes.cf :
/etc/postfix/mysql-virtual_mailboxes.cf

1 user = mail_admin
2 password = mail_admin_password
3 dbname = mail
4 query = SELECT CONCAT(SUBSTRING_INDEX(email,<'@'>,-
5 1),'/',SUBSTRING_INDEX(email,<'@'>,1),'/') FROM users WHERE email='%s'
hosts = 127.0.0.1
4. Create a virtual email mapping file for Postfix called  /etc/postfix/mysql-
virtual_email2email.cf :
/etc/postfix/mysql-virtual_email2email.cf

user = mail_admin
1 password = mail_admin_password
2 dbname = mail
3 query = SELECT email FROM users WHERE email='%s'
4 hosts = 127.0.0.1
5

5. Set proper permissions and ownership for these configuration files:

chmod o= /etc/postfix/mysql-virtual_*.cf
1 chgrp postfix /etc/postfix/mysql-virtual_*.cf
2

6. Create a user and group for mail handling. All virtual mailboxes will be stored under this
user’s home directory:

groupadd -g 5000 vmail


1 useradd -g vmail -u 5000 vmail -d /home/vmail -m
2

7. Complete the remaining steps required for Postfix configuration. Please be sure
to replace server.example.com  with the Linode’s fully qualified domain name. If you
are planning on using your own SSL certificate and key,
replace  /etc/pki/dovecot/private/dovecot.pem  with the appropriate path:
1 postconf -e 'myhostname = server.example.com'
2 postconf -e 'mydestination = $myhostname, localhost,
3 localhost.localdomain'
4 postconf -e 'mynetworks = 127.0.0.0/8'
5 postconf -e 'inet_interfaces = all'
6 postconf -e 'message_size_limit = 30720000'
7 postconf -e 'virtual_alias_domains ='
8 postconf -e 'virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-
9 virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf'
10 postconf -e 'virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-
11 virtual_domains.cf'
12 postconf -e 'virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-
13 virtual_mailboxes.cf'
14 postconf -e 'virtual_mailbox_base = /home/vmail'
15 postconf -e 'virtual_uid_maps = static:5000'
16 postconf -e 'virtual_gid_maps = static:5000'
postconf -e 'smtpd_sasl_type = dovecot'
postconf -e 'smtpd_sasl_path = private/auth'
postconf -e 'smtpd_sasl_auth_enable = yes'
postconf -e 'broken_sasl_auth_clients = yes'
postconf -e 'smtpd_sasl_authenticated_header = yes'
17 postconf -e 'smtpd_recipient_restrictions = permit_mynetworks,
18 permit_sasl_authenticated, reject_unauth_destination'
19 postconf -e 'smtpd_use_tls = yes'
20 postconf -e 'smtpd_tls_cert_file = </etc/pki/dovecot/certs/dovecot.pem'
21 postconf -e 'smtpd_tls_key_file = </etc/pki/dovecot/private/dovecot.pem'
22 postconf -e 'virtual_create_maildirsize = yes'
23 postconf -e 'virtual_maildir_extended = yes'
24 postconf -e 'proxy_read_maps = $local_recipient_maps $mydestination
25 $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps
26 $virtual_mailbox_domains $relay_recipient_maps $relay_domains
$canonical_maps $sender_canonical_maps $recipient_canonical_maps
$relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps'
postconf -e 'virtual_transport = dovecot'
postconf -e 'dovecot_destination_recipient_limit = 1'

8. Edit the file  /etc/postfix/master.cf  and add the Dovecot service to the bottom
of the file:
/etc/postfix/master.cf

dovecot unix - n n - - pipe


1 flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f $
2 {sender} -d ${recipient}

9. Configure Postfix to start on boot and start the service for the first time:

chkconfig postfix on
1 service postfix start
2

This completes the configuration for Postfix.

Configure Dovecot
1. Move  /etc/dovecot/dovecot.conf  to a backup file:
mv /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf-backup
1

2. Copy the following into the now-empty  dovecot.conf  file, substituting your
system’s domain name for  example.com  in line 37:
/etc/dovecot/dovecot.conf

1 protocols = imap pop3


2 log_timestamp = "%Y-%m-%d %H:%M:%S "
3 mail_location = maildir:/home/vmail/%d/%n/Maildir
4
5 ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
6 ssl_key = </etc/pki/dovecot/private/dovecot.pem
7
8 namespace {
9 type = private
10 separator = .
11 prefix = INBOX.
12 inbox = yes
13 }
14
15 service auth {
16 unix_listener auth-master {
17 mode = 0600
18 user = vmail
19 }
20
21 unix_listener /var/spool/postfix/private/auth {
22 mode = 0666
23 user = postfix
24 group = postfix
25 }
26
27 user = root
28 }
29
30 service auth-worker {
31 user = root
32 }
33
34 protocol lda {
35 log_path = /home/vmail/dovecot-deliver.log
36 auth_socket_path = /var/run/dovecot/auth-master
37 postmaster_address = postmaster@example.com
38 }
39
40 protocol pop3 {
41 pop3_uidl_format = %08Xu%08Xv
42 }
43
44 passdb {
45 driver = sql
46 args = /etc/dovecot/dovecot-sql.conf.ext
47 }
48
49 userdb {
driver = static
50 args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
51 }
52

3. MySQL will be used to store password information, so  /etc/dovecot/dovecot-


sql.conf.ext  must be created. Insert the following contents into the file, making
sure to replace  mail_admin_password with your mail password:
/etc/dovecot/dovecot-sql.conf.ext

driver = mysql
connect = host=127.0.0.1 dbname=mail user=mail_admin
1 password=mail_admin_password
2 default_pass_scheme = CRYPT
3 password_query = SELECT email as user, password FROM users WHERE
4 email='%u';

4. Restrict access to the file by changing the permissions to allow users in


the  dovecot  group to access it, while denying access to others:
chgrp dovecot /etc/dovecot/dovecot-sql.conf.ext
1 chmod o= /etc/dovecot/dovecot-sql.conf.ext
2

5. Configure Dovecot to start on boot, and start it for the first time:

chkconfig dovecot on
1 service dovecot start
2

6. Check  /var/log/maillog  to make sure Dovecot started without errors. Your log
should have lines similar to the following:
/var/log/maillog

Mar 18 15:21:59 sothoryos postfix/postfix-script[3069]: starting the


Postfix mail system
1 Mar 18 15:22:00 sothoryos postfix/master[3070]: daemon started -- version
2 2.6.6, configuration /etc/postfix
3 Mar 18 15:32:03 sothoryos dovecot: master: Dovecot v2.0.9 starting up
(core dumps disabled)

7. Test your POP3 server to make sure it’s running properly:


yum install telnet
1 telnet localhost pop3
2

8. The terminal should output results similar to the following:

Trying 127.0.0.1...
1 Connected to localhost.localdomain.
2 Escape character is '^]'.
3 +OK Dovecot ready.
4

9. Enter the command  quit  to return to your shell. This completes the Dovecot
configuration. Next, you’ll make sure aliases are configured properly.
Configure Mail Aliases
1. Edit the file  /etc/aliases , making sure the  postmaster  and  root  directives are
set properly for your organization:
/etc/aliases

postmaster: root
1 root: postmaster@example.com
2

2. Update aliases and restart Postfix:

newaliases
1 service postfix restart
2

This completes alias configuration. Next, test Postfix to make sure it’s operating
properly.

Testing Postfix
1. Test Postfix for SMTP-AUTH and TLS:

telnet localhost 25
1

2. While still connected, issue the following command:

1ehlo localhost
3. You should see output similar to the following:

250-hostname.example.com
1 250-PIPELINING
2 250-SIZE 30720000
3 250-VRFY
4 250-ETRN
5 250-STARTTLS
6 250-AUTH PLAIN
7 250-AUTH=PLAIN
8 250-ENHANCEDSTATUSCODES
9 250-8BITMIME
10 250 DSN
11

4. Issue the command  quit  to terminate the telnet connection.


Next, populate the MySQL database with domains and email users.

Set Up and Test Domains and Users


Before continuing, modify the DNS records for any domains that you wish to handle
email by adding an MX record that points to your mail server’s fully qualified domain
name. If MX records already exist for a domain you would like to handle the email for,
either delete them or set them to a higher priority number than your mail server. Smaller
priority numbers indicate higher priority for mail delivery, with “0” being the highest
priority.
In the following example, the MySQL shell is used to add support for the domain
“example.com”, which will have an email account called “sales”.

1. Log into the MySQL shell:

mysql -u root -p
1

2. Switch to the  mail  database, add support for your domain, and create an email
account. Be sure to replace  example.com  with your domain
name,  sales@example.com  with your chosen email, and  password  with a strong
password:
1 USE mail;
2 INSERT INTO domains (domain) VALUES ('example.com');
3 INSERT INTO users (email, password) VALUES ('sales@example.com',
4 ENCRYPT('password'));
quit
3. Prior to accessing any newly-created email account, a test message needs to be sent to
create that user’s mailbox:

yum install mailx


1 mailx sales@example.com
2

4. Press  Ctrl+D  to complete the message. You can safely leave the field
for  Cc:  blank. This completes the configuration for a new domain and email user.
Given the possibility for virtual hosting a large number of domains on a single mail
system, the username portion of an email address (i.e. before the  @  sign) is not
sufficient for authentication. When email users authenticate to the server, they must
supply the entire email address created above as their username.

Check Your Logs


After the test mail is sent, check the mail logs to make sure the mail was delivered.

1. Check the  maillog  located in  /var/log/maillog . You should see something
similar to the following:
/var/log/maillog

Mar 18 15:39:07 server postfix/cleanup[3252]: 444E34055: message-


id=<20150318153907.444E34055@server.example.com>
Mar 18 15:39:07 server postfix/qmgr[3218]: 444E34055:
1 from=<root@server.example.com>, size=489, nrcpt=1 (queue active)
2 Mar 18 15:39:07 server postfix/pipe[3258]: 444E34055:
3 to=<sales@example.com>, relay=dovecot, delay=0.09,
4 delays=0.04/0.01/0/0.05, dsn=2.0.0, sta$
Mar 18 15:39:07 server postfix/qmgr[3218]: 444E34055: removed

2. Check the Dovecot delivery log located in  /home/vmail/dovecot-deliver.log . The


contents should look similar to the following:
/home/vmail/dovecot-deliver.log

deliver(<sales@example.com>): 2011-01-21 20:03:19 Info:


msgid=\<<20110121200319.E1D148908@hostname.example.com>>: saved mail to
1 INBOX

Now you can test to see what the users of your email server would see with their email
clients.
Test the Mailbox
1. To test the  sales@example.com  mailbox, navigate to the mailbox
directory /home/vmail/example.com/sales/Maildir  and issue the following command:
cd /home/vmail/example.com/sales/Maildir
1 find
2

2. You should see output similar to the following:

.
1 ./dovecot-uidlist
2 ./cur
3 ./new
4 ./new/1285609582.P6115Q0M368794.li172-137
5 ./dovecot.index
6 ./dovecot.index.log
7 ./tmp
8

3. Test the maillbox by using a mail client. For this test, using mutt is
recommended. If it is not installed by default, install it with  yum install mutt , then
run:
mutt -f .
1

4. You may be prompted to create the root mailbox. This is not required.
5. If there is an email in the inbox, Postfix, Dovecot, and MySQL have been
successfully configured! To quit mutt press  q .

You might also like