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 [email protected] are expanded by Postfix to a real
mailbox ([email protected]) before delivery.
What happens
1. Dovecot's LHLO reply advertises 8BITMIME, CHUNKING, ENHANCEDSTATUSCODES,
PIPELINING, STARTTLS, but not DSN.
2. Postfix only sends the ORCPT parameter (RFC 3461) to servers that advertise
DSN, so it sends RCPT TO:<[email protected]> with no ORCPT.
3. 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:<[email protected]>
RCPT TO:<[email protected]> ORCPT=rfc822;[email protected]
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
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]