[PLUG] Postfix + Dovecot

Brian Martin plugng3 at martinconsulting.com
Wed Feb 18 20:27:56 UTC 2015


On 02/18/2015 12:00 PM, plug-request at lists.pdxlinux.org wrote:
> Re: Postfix + Dovecot
Rich,

I've been using Postfix and Dovecot for years.  One key concept is that 
Dovecot only provides a user interface to the received mail. That is, it 
lets the end user look at their mail box, read and delete mail, create  
and delete folders in the mail box, etc.  It never sends outbound mail 
-- that's Postfix's province.  This is why you need separate 
specifications with separate ports in the mail client for the inbound 
and outbound servers, even though they might just be on the same 
machine.  You're talking to different programs for different services, 
so you need different ports.

Here's a known, working set of configuration files (minus some real 
domain names).  I haven't reviewed this in a while so I won't promise 
it's optimum, but it works and should help you on your way:

dovecot.conf:
------------------
auth_mechanisms = plain login
login_greeting = Ready.
listen = *
mail_location = maildir:/var/spool/mail/%u
namespace {
   inbox = yes
   location =
   prefix =
   separator = /
   type = private
}
namespace {
   location = maildir:/var/spool/mail/%u/Trash
   prefix = Trash/
   separator = /
   type = private
}
passdb {
   driver = pam
}
plugin {
   lazy_expunge = Trash/
   sieve = ~/.dovecot.sieve
   sieve_storage = ~/sieve
}
protocols = imap
service auth {
   unix_listener /var/spool/postfix/private/auth {
     group = postfix
     mode = 0660
     user = postfix
   }
   user = root
}
service imap-login {
   inet_listener imap {
     port = 0
   }
}
ssl_cert = 
</usr/local/etc/ssl/mail.example.com/mail.example.com.combined.crt
ssl_key  = </usr/local/etc/ssl/mail.example.com/mail.example.com.key
ssl_cipher_list = 
ALL:!LOW:!MEDIUM:!MD5:!SSL2:!EXP-ADH-DES-CBC-SHA:!EXP-EDH-RSA-DES-CBC-SHA:!EXP-DES-CBC-SHA:!EXP-EDH-RSA-DES-CBC-SHA:!EXP-ADH-DES-CBC-SHA:!EXP-DES-CBC-SHA:!ADH-AES256-SHA:!ADH-AES128-SHA:!ADH-DES-CBC3-SHA:!EXP-ADH-DES-CBC-SHA:!EXP-ADH-DES-CBC-SHA:!ADH-DES-CBC3-SHA 
# Should probably be updated
userdb {
   driver = passwd
}
protocol imap {
   mail_plugins = lazy_expunge
}
protocol pop3 {
}
protocol lda {
   mail_plugins = sieve
   postmaster_address = postmaster at example.com
}

----------------------------------------------
postfix.conf (relevant portions only)
----------------------------------------------
mailbox_command = /usr/lib/dovecot/deliver -a "$RECIPIENT"    # this is 
old-school
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot

---------------------------------------------

                     -Brian

-- 
--------------------
Brian P. Martin, Chief Consultant
Martin Consulting Services, Inc.
Phone: 503-617-4500
E-mail: Brian at MartinConsulting.com




More information about the PLUG mailing list