procmail
[Top] [All Lists]

A more general X-Envelope-To

2002-02-27 10:03:40
Hi!

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:

@domain.com     domuser+%1
or
@domain.com     domuser+%1(_at_)localhost

and in the respective domuser's $HOME/.procmailrc:

      DOMAIN=domain.com
      ENV_TO=$1

      :0f
      * ENV_TO ?? .
      | formail -i "X-Envelope-To: "$ENV_TO(_at_)$DOMAIN

      :0fE
      | 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.

Any ideas?

/Fredrik

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>