This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.

Dovecot LDA as local delivery agent for ZMailer

1. Add to zmailer/sm.conf:

# dovecot LDA
dovecot SPfne  /usr/local/libexec/dovecot/dovecot-lda  dovecot-lda -e -d $u

2. Change zmailer/scheduler.conf:

Set local/file* and local/pipe* to use "mailbox" delivery agent:

local/file*
local/pipe*
        ...
        # ZMailer local delivery transport agent
        command="mailbox -8HS -l ${LOGDIR}/mailbox"

and all the other local/* to use Dovecot LDA:

local/*
        ...
        # Dovecot as the local delivery agent:
        command="sm -8Hc $channel dovecot"

This makes all deliveries to local users go via Dovecot LDA, but users can also run pipes or store to files in their .forward files. (This is why there are tag-matchers for "local/file*" and "local/pipe*" before "local/*" in the scheduler.conf file; those are for the cases that must not go via Dovecot LDA.)

If you're going to use dovecot-lda's -e parameter you'll need to patch either Dovecot or ZMailer sources. When dovecot-lda wants to reject mails, it exits with EX_NOPERM code, but ZMailer thinks this isn't normal and logs "(this is abnormal, investigate!)".

ZMailer fix in zmailer/transports/libta/diagnostic.c:

   1 -      case EX_NOPERM:
   2        case EX_PROTOCOL:
   3        case EX_USAGE:
   4                strcat(message,
   5                       " (this is abnormal, investigate!)");
   6                s += strlen(s);
   7                /* fall through */
   8 +      case EX_NOPERM:
   9        case EX_NOUSER:
  10        case EX_NOHOST:
  11        case EX_UNAVAILABLE:

Or Dovecot fix in dovecot-2.0/src/lda/main.c:

   1                 if (stderr_rejection)
   2 -                       return EX_NOPERM;
   3 +                       return EX_UNAVAILABLE;
   4 

Russian topic at http://kocmuk.ru/2009/10/18/dovecot-lda-vs-zmailer-lda/

LDA/ZMailer (last edited 2010-06-15 18:50:58 by TimoSirainen)