In the meantime I think I found the right way, but unfortunately it still doesn't work, can anyone point out what I'm doing wrong?
added mailbox
foo@example.com in Zimbra
added the following line in /opt/zimbra/postfix/conf/master.cf.in just above the maildrop line:
my_transport unix - n n - - pipe flags=Rq user=zimbra argv=/opt/test.rb --some arguments -a blah
added the following line in /opt/zimbra/postfix/conf/transport:
/^
foo@example.com$/ my_transport:dummy
Checked and activated the transport map with:
$ /opt/zimbra/postfix/sbin/postmap -q
foo@example.com regexp:/opt/zimbra/postfix/conf/transport
$ sudo /opt/zimbra/postfix/sbin/postmap /opt/zimbra/postfix/conf/transport
Became zimbra user and restarted the mta:
$ sudo su - zimbra
$ zmmtactl reload
This reported it rewrote the postfix config as well and indeed master.cf has been rewritten to include the my_transport line.
Sending mail to
foo@example.com still delivers it into the account's mailbox though instead of piping it into the script.