LMTP: advertise DSN so MTAs send ORCPT (it is already honoured)
Hello,
When moving from dovecot-lda (deliver -a ${original_recipient}) to LMTP, the original envelope recipient is lost, even though Dovecot's LMTP already supports it.
Setup
- Dovecot 2.4.1-4 (Debian 13, 1:2.4.1+dfsg1-6+deb13u7), Pigeonhole sieve.
- Postfix delivering with virtual_transport = lmtp:unix:private/dovecot-lmtp.
- Aliases such as postmaster@example.com are expanded by Postfix to a real mailbox (user@example.com) before delivery.
What happens
- Dovecot's LHLO reply advertises 8BITMIME, CHUNKING, ENHANCEDSTATUSCODES, PIPELINING, STARTTLS, but not DSN.
- Postfix only sends the ORCPT parameter (RFC 3461) to servers that advertise DSN, so it sends RCPT TO:<user@example.com> with no ORCPT.
- Sieve's envelope "to" therefore sees only the final address. A rule that worked under dovecot-lda with -a stops matching: if envelope :localpart :is "to" "postmaster" { ... }
But ORCPT is honoured when sent. Talking to the LMTP socket by hand: LHLO test MAIL FROM:<user@example.com> RCPT TO:<user@example.com> ORCPT=rfc822;postmaster@example.com DATA ... The message is accepted, and the sieve rule above matches, so the original recipient reaches sieve. The same message without ORCPT does not match.
Request. Could LMTP advertise DSN in its LHLO reply, either always or behind a setting? Since ORCPT is already parsed and used, this looks like a small change, and MTAs would then pass the original recipient. That would make LMTP equivalent to deliver -a for sieve envelope tests, and presumably for lmtp_hdr_delivery_address = original.
If there's an existing way to get this that I've missed, I'd be glad to hear it.
Thanks, Dhaval Patel
participants (1)
-
Dhaval Patel