:: How to installing Postfix and Dovecot on Linux CentOS

yum install postfix dovecot
chkconfig postfix on
chkconfig dovecot on

 
:: How to configure Postfix for Dovecot
+ configure main.cf

vi /etc/postfix/main.cf
# change or add on these line:
myhostname = mail.fileregion.com
mydomain = fileregion.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8
home_mailbox = Maildir/

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, permit
broken_sasl_auth_clients = yes

+ restarting postfix

/etc/init.d/postfix restart

 
:: Configure Dovecot on Linux CentOS 6
+ configure dovecot.conf

vi /etc/dovecot/dovecot.conf
# uncomment on this line:
protocols = imap pop3
listen = *

+ config mail auth mehanism

vi /etc/dovecot/conf.d/10-auth.conf
# change on these line:
disable_plaintext_auth = no
auth_mechanisms = plain login

+ configure mail_location

vi /etc/dovecot/conf.d/10-mail.conf
# change / uncomment on this line:
mail_location = maildir:~/Maildir

+ configure service auth

vi /etc/dovecot/conf.d/10-master.conf
# commented on these line:
#unix_listener auth-userdb {
    #mode = 0600
    #user =
    #group =
  #}

# change or setup on these line:
# Postfix smtp-auth
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    user = postfix
    group = postfix
  }

+ configure pop3

vi /etc/dovecot/conf.d/20-pop3.conf
# uncomment on these line:
pop3_uidl_format = %08Xu%08Xv
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh

+ restaring Dovecot

/etc/init.d/dovecot restart

 
+ Google
+ ServerWorld

Hi, Iā€™m Sysadmin.ID

24 Comments

  1. Hi blackonsole,

    I setup postfix server for the first time with your help, this is the best how-to I found on internet to setup postfix-dovecot

    Thanks a million

  2. Awesome guide. Wish I’d found this in the morning. Found the last few tweaks that I needed here, but this guide had nearly everything I needed for today.

  3. Hi blackonsole,

    I just want to thank you.
    “I setup postfix server for the first time with your help, this is the best how-to I found on internet to setup postfix-dovecot…”

    Carlos

  4. Fantastic tutorial! This is very helpful and a little different from CentOS 5 which was a pain. This tutorial worked flawless except for one thing.

    I’m running CentOS 6.3 and by default I had this line uncommented in my ‘/etc/postfix/main.cf’ file: ‘inet_interfaces = localhost’

    I had to comment this line out and ONLY have what you had:
    ‘inet_interfaces = all’

    Restarted postfix and then I could send email. Thanks for a great article! šŸ™‚

  5. hi

    i configured postfix mail server
    but i want a web panel from where i can create or delete email id’s. is there any way to do this kind of task.

    cheers

    laxman

  6. help :

    Starting Dovecot Imap: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-master.conf line 88: Unknown setting: unix_listener
    [FAILED]

    thanks.

    1. I’m having the same issue here. Base CentOS 6.3 install and new to Linux so just following your tutorial here leads to this error. Is there some steps we should have followed before hand to set up the “unix_listener”? What you have as line 11 in your “+configure service auth” section is where it says the error lies but it looks to me like it’s exactly as you have it here. If this works it’ll be the only step by step I’ve found so far so lets cross our fingers we can get this little road-bump smoothed out. Appreciate your help Blackonsole! Obviously this has helped a lot of people and you should be proud even if I can’t get it working

      1. Of course immediately after I post I realize that I forgot to comment out the closing curly brackets of the # unix_listener auth-userdb settings. So immediately before trying to run the unix_listener I was closing more arguments than existed probably causing a force closure. I hope Andy checks back for the answer because I would guess this is what he did too. GL all and thanks for your tutorial Blackonsole!

    1. Kasi, you can setup virtual domain in /etc/postfix/virtual then run these command:
      postmap /etc/postfix/virtual
      postfix reload

      thanks.

      1. So, i just put my domains on /etc/postfix/virtual separated by line? OK. But how do i make virtual users. Let’s say I want to have 20 domains that have email [email protected], [email protected], etc. I don’t want unix users, I want only mail users. All admins will use thunderbird (imap accounts, so dovecot will be needed) to read/send mail, so they can manage their websites.

        1. I think i got it. One unix user and group has to be specified to own the mail base folder specified in the config of postfix, the virtual users have to be specified there, too.

  7. Is this config for a full mail server, meaning you’ll be sending and receiving email?

    If I just want to be able to only send email from my PHP application do I follow the same config.

    Thank you.

  8. Hi, thanks for a great tutorial. I wondered how you enable TLS with postfix? I noticed you’re setting up sasl in the main.cf config but it won’t accept ssl connections.

    Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *