procmail
[Top] [All Lists]

Re: Recipe help

1998-11-04 19:18:19
Brent Sims <brent(_at_)rmi(_dot_)net> writes:
      I want to capture mail sent to an address and send it to another
address. Simple enough. The first two lines of my current recipe are as
follows

:0
* ^To:(_dot_)*user(_at_)domain(_dot_)com

      What I'm concerned about is matching on something similar and
thereby throwing things out of wack. I'm just gropping along as far as
procmail is concerned. And what I'd like to know if there is a simple way
to make sure that the recipe will only catch user(_at_)domain(_dot_)com

Why is email addressed to user(_at_)domain(_dot_)com being processed by 
procmail?

If this is the procmailrc in the user(_at_)domain(_dot_)com's account, then 
*all*
the mail being processed by this recipe are _to_ user(_at_)domain(_dot_)com,
regardless of what the header shows (for example, mail from mailing
lists doesn't actually list the recipient addresses in the To: or Cc:
headers).

If domain.com is a virtual-domain and email sent to any address at
domain.com ends up being processed by the same procmailrc, then the
software that is doing the 'virtualizing' should be passing along to
procmail the list of 'envelope recipients', either on procmail's
command line or in a separate header line "X-Envelope-To:".  You can
then check that source of information to determine whether this message
was to user(_at_)domain(_dot_)com(_dot_)  Once again, you ignore the To: and Cc:
headers.

If the forwarding of email from user(_at_)domain(_dot_)com to this address is
done by a .forward file or alias or something like that, then you
should change that alias to tag the message before forwarding it,
and then this procmailrc can check for the presence of that tag.

If none of those match your situation, you'll have to clarify what's
going on behind the scenes.


Philip Guenther

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