1

I'm trying to pipe incoming email for helpdesk@example.org to a script called rt-mailgate, while sending the rest of my incoming emails (anything...@example.org) 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 helpdesk@example.org 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:

helpdesk@example.org rt
helpdesk1@example.org rt@localhost
helpdesk2@example.org rt@svava.valhall.example.org

/etc/postfix/transport:

rt@localhost rt:
rt@svava.valhall.example.org 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=<CAJFiUZr+22UEWrXbmy2PmJsk@mail.gmail.com>
Jun  7 18:55:11 svava postfix/qmgr[2053]: 0129240E2A: from=<some.random@gmail.com>, 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 <CAJFiUZr+22UEWrJskAH0OjVjAJ6E2avAwzNk675OV3Q@mail.gmail.com> 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=<CAJFiUZr+22UEWrXbmy2PmJskAH0OjVjAJ6E2aOV3Q@mail.gmail.com>,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=<rt@svava.valhall.example.org>, orig_to=<helpdesk@example.org>, 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 helpdesk@example.org to rt@svava.valhall.example.org) 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.