I'm trying to pipe incoming email for [email protected] to a script called rt-mailgate, while sending the rest of my incoming emails ([email protected]) to Dovecot with ldap and spamassassin. Everything works great except my pipe to rt-mailgate. All mails are instead delivered via the ”smtp” service in master.cf (which is to ldap-dovecot via spamassassin) so my transport mapping for [email protected] to the ”rt” service is ignored. (I have not forgot to run postmap or anything).
This is my configuration.
/etc/postfix/master.cf:
smtp inet n - - - - smtpd -o content_filter=spamassassin
spamassassin unix - n n - - pipe flags=DROhu user=postoffice argv=/usr/bin/spamc -u debian-spamd -f -e /usr/lib/dovecot/deliver -f ${sender} -d ${user}
rt unix - n n - - pipe flags=R user=postoffice argv=/usr/bin/rt-mailgate --queue ${user} --action correspond --url http://rt.example.org/
/etc/postfix/main.cf:
myhostname = svava.valhall.example.org
myorigin = svava.valhall.example.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = svava.valhall.example.org, svava.example.org, localhost
transport_maps = hash:/etc/postfix/transport
virtual_mailbox_domains = freja.valkyria.example.org example.org
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_alias_maps = hash:/etc/postfix/virtual, ldap:/etc/postfix/ldap-aliases.cf
/etc/postfix/virtual:
[email protected] rt
[email protected] rt@localhost
[email protected] [email protected]
/etc/postfix/transport:
rt@localhost rt:
[email protected] rt:
localhost rt:
This is the output: (same for helpdesk1,2)
Jun 7 18:55:10 svava postfix/smtpd[2060]: connect from unknown[172.18.10.165]
Jun 7 18:55:11 svava postfix/smtpd[2060]: 0129240E2A: client=unknown[172.18.10.165]
Jun 7 18:55:11 svava postfix/cleanup[2065]: 0129240E2A: message-id=<[email protected]>
Jun 7 18:55:11 svava postfix/qmgr[2053]: 0129240E2A: from=<[email protected]>, size=5569, nrcpt=1 (queue active)
Jun 7 18:55:11 svava spamd[1099]: spamd: connection from localhost [::1]:48588 to port 783, fd 6
Jun 7 18:55:11 svava spamd[1099]: spamd: setuid to debian-spamd succeeded
Jun 7 18:55:11 svava spamd[1099]: spamd: processing message <[email protected]> for debian-spamd:112
Jun 7 18:55:11 svava postfix/smtpd[2060]: disconnect from unknown[172.18.10.165]
Jun 7 18:55:11 svava spamd[1099]: spamd: clean message (-0.0/1.8) for debian-spamd:112 in 0.3 seconds, 5569 bytes.
Jun 7 18:55:11 svava spamd[1099]: spamd: result: . 0 - HTML_MESSAGE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID,URIBL_BLOCKED scantime=0.3,size=5569,user=debian-spamd,uid=112,required_score=1.8,rhost=localhost,raddr=::1,rport=48588,mid=<[email protected]>,autolearn=ham autolearn_force=no
Jun 7 18:55:11 svava spamd[1098]: prefork: child states: II
Jun 7 18:55:11 svava dovecot: auth: ldap(rt): unknown user
Jun 7 18:55:11 svava dovecot: auth-worker(2068): ldap(rt): unknown user
Jun 7 18:55:11 svava dovecot: auth-worker(2068): ldap(rt): unknown user
Jun 7 18:55:11 svava postfix/pipe[2055]: 0129240E2A: to=<[email protected]>, orig_to=<[email protected]>, relay=spamassassin, delay=0.68, delays=0.28/0/0/0.39, dsn=5.1.1, status=bounced (user unknown)
As the log shows, Postfix is correctly following my mapping in /etc/postfix/virtual (address is correctly changed from [email protected] to [email protected]) but then my entry in /etc/postfix/transport is being ignored, which is my problem. Postfix sends the output to Spamassassin-Dovecot instead of to the expected rt-mailgate script.