On 2019-05-21 18:42, MRob wrote:
For some time it is possible to make postfix virtual tell a LDA who is
the original recipient, add x-original-to header. But not LMTP. This
create problems in final delivery, one example is autoreply vacation
program cannot check if message was addressed directly to this user or
not, so many autoreplyies are sent when it should not happen.

Feature request for this seems stalled, but in meantime, is there any
workaround?

It seems like a good workaround would be to use lmtp_header_checks if it could only have a variable in the header check for the original recipient, this would be nice but its not valid.

/./ prepend X-Original-To: ${original_recipient}

I found this does work:

smtpd_recipient_restrictions=check_recipient_access pcre:/etc/postfix/add-original-to.pcre

$ cat /etc/postfix/add-original-to.pcre
/(.+)/ prepend X-Original-To: $1

But for multirecipient mails it makes one X-Original_To header for every recipient so privacy is broken (like maybe for BCC recipients). I could only fix this by setting:

smtpd_recipient_limit=1

But I think its bad behavior toward other mail servers and will delay mail quite a bit.

Though still has another problem, if mail is forwarded thru another server that adds X-Original-To I don't find a way to remove the previous X-Original_To header that doesnt also remove the one we want to add.???

Reply via email to