Is there a way to add the X-Envelope-To header in a more general fashion?
I'd like to have a single recipe in /etc/procmailrc that always adds this
header regardless of domain. We have a few hundred domains, and I'd like to
avoid creating separate .procmailrc:s for those..., not that they all need
them, but it could come in handy in some cases.
Normally, you add +%1 in virtusertable:
and in the respective domuser's $HOME/.procmailrc:
* ENV_TO ?? .
| formail -i "X-Envelope-To: "$ENV_TO(_at_)$DOMAIN
| formail -i "X-Envelope-To: UNKNOWN"
The key to making a generalized script would be to assign a variable the
domain part of the address (tried %2, but it didn't work). Obviously, we
need the real recipient domain, not just any domain from the To: header
since the need for X-Envelope-To arises when people receives Bcc-addressed
mail or mail from mailing lists.
procmail mailing list