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

Dovecot LDA as local delivery agent for ZMailer

1. Add to zmailer/sm.conf:

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

2. Change zmailer/scheduler.conf like this:

Go local/file* and local/pipe* thru "mailbox" delivery agent:

        # zmailer local delivery transport agent
        command="mailbox -8HS -l ${LOGDIR}/mailbox"

and after that go all other local/* thru dovecot LDA:

        # DOVECOT as the local delivery agent:
        command="sm -8Hc $channel dovecot"

Then all deliveries to local users will go thru dovecot LDA, AND if users want to run pipes / store to files thru their .forward files, they can do that too. (That is why there are tag-matchers for "local/file*" and "local/pipe*" before "local/*" in that scheduler.conf file; those are for cases which must not run thru dovecot LDA.)

But little problem now: if you will start use "-e" deliver param, Zmailer start complain on reject case: "(this is abnormal, investigate!)".

Fix Zmailer: in zmailer/transports/libta/diagnostic.c:

-      case EX_NOPERM:
       case EX_PROTOCOL:
       case EX_USAGE:
                      " (this is abnormal, investigate!)");
               s += strlen(s);
               /* fall through */
+      case EX_NOPERM:
       case EX_NOUSER:
       case EX_NOHOST:
       case EX_UNAVAILABLE:

Or fix Dovecot: in dovecot-1.2.6/src/deliver/deliver.c:

                if (stderr_rejection)
-                       return EX_NOPERM;
+                       return EX_UNAVAILABLE;