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':

---%<-------------------------------------------------------------------------
mailbox_command = /usr/local/libexec/dovecot/deliver
---%<-------------------------------------------------------------------------

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
[http://heinous.org/wiki/Virtual_Domains,_Postfix,_Dovecot_LDA,_and_LDAP]

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':

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

An example using '+' extensions. In order to keep ${extension} with the proper
case, the 'hu' flags are not used so be sure to utilize<Modifiers>
[Variables.txt] in your dovecot.conf for mail locations and other configuration
parameters.

---%<-------------------------------------------------------------------------
# Dovecot LDA
dovecot unix    -       n       n       -       -      pipe
  flags=DR user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -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_transport = dovecot
---%<-------------------------------------------------------------------------

And remember to run

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

Postfix mail_debug caveat
-------------------------

This is a problem with Dovecot versions older than v1.0.rc26:

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 [http://www.postfix.org/DEBUG_README.html] 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 mailstore tip
--------------------------------

If you are experiencing problems with deliver processes hanging when delivering
to an NFS mailstore, its likely the deliver process is hanging waiting for free
locks.  The occurance 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-04-06 04:42)
