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 firstname.lastname@example.org
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:/^email@example.com
Checked and activated the transport map with:
$ /opt/zimbra/postfix/sbin/postmap -q firstname.lastname@example.org
$ 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 email@example.com
still delivers it into the account's mailbox though instead of piping it into the script.