

Dovecot LDA with Postfix
========================




System users
============


If you wish you use 'deliver' for all system users on a single domain mail host you can do it by editing 'mailbox_command' parameter in 
'/etc/postfix/main.cf' (postconf(5) [None]): 

---%<-------------------------------------------------------------------------
mailbox_command = /usr/local/libexec/dovecot/deliver
#  or
mailbox_command = /usr/libexec/dovecot/deliver
#  or
mailbox_command = /usr/lib/dovecot/deliver
#  or wherever it was installed in your system.
---%<-------------------------------------------------------------------------

Then run 'postfix reload' and that is it. 
Some detailed config files and examples at http://heinous.org/wiki/Virtual_Domains%2C_Postfix%2C_Dovecot_LDA%2C_and_LDAP [None] 


Virtual users
=============


Dovecot LDA is very easy to use on large scale installations with Postfix virtual domains support, just add a 'dovecot' service in '/etc/postfix/master.cf' (master(8) [None]): 

---%<-------------------------------------------------------------------------
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}
---%<-------------------------------------------------------------------------

An example using '+' extensions. (If you wish to preserve the case of ${extension}, remove the the 'hu' flags [None], and be sure to utilize >>Modifiers<< in your dovecot.conf for mail locations and other configuration parameters that are expecting lower case.) 

---%<-------------------------------------------------------------------------
dovecot unix    -       n       n       -       -      pipe
  flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -n -m ${extension}
---%<-------------------------------------------------------------------------

Replace 'vmail' above with your virtual mail user account. 
Then set 'virtual_transport' to 'dovecot' in '/etc/postfix/main.cf': 

---%<-------------------------------------------------------------------------
dovecot_destination_recipient_limit = 1
virtual_mailbox_domains = your.domain.here
virtual_transport = dovecot ---%<-------------------------------------------------------------------------

And remember to run 

---%<-------------------------------------------------------------------------
postfix reload---%<-------------------------------------------------------------------------



Virtual users with multiple uids/gids
=====================================


If you need multiple uids/gids you'll need to set deliver setuid root. See the >>LDA<< main page how to do this securely. 


Postfix mail_debug caveat
=========================


This is a problem with Dovecot versions older than v1.0.1: 
Be sure that the 'mail_debug' setting is commented out in 'dovecot.conf', because otherwise the postfix sendmail replacement will be started in the debugger using debugger_command [None] and delayed for five seconds. It is not enough to set 'mail_debug' to 'no', because postfix's sendmail command checks for the existence of the MAIL_DEBUG environment variable, which is created by the dovecot lda as soon as a 'mail_debug' setting is present. 


Postfix with a NFS mail store
=============================


If you are experiencing problems with deliver processes hanging when delivering to a NFS mail store, it's likely that the deliver process is hanging while waiting for free locks.  The occurrence of this can be greatly reduced, if not eradicated, by forcing Postfix to only deliver to the same recipient one at a time. 

---%<-------------------------------------------------------------------------
dovecot_destination_concurrency_limit = 1---%<-------------------------------------------------------------------------

(This file was created from the wiki on 2007-12-11 04:42)
