procmail
[Top] [All Lists]

Re: Delivered-To: [adding it]

1999-06-17 01:10:48
On 16 Jun 1999 05:08:55 -0700, Harry Putnam <reader(_at_)newsguy(_dot_)com>
wrote:
Liviu Daia <Liviu(_dot_)Daia(_at_)imar(_dot_)ro> writes:
On 15 June 1999, Harry Putnam <reader(_at_)newsguy(_dot_)com> wrote:
Can be forwarded from those machines with a header added to make
them easily filterable when they arrive at: reader(_at_)newsguy(_dot_)com
Most of the time this is accomplished by filtering on the "To: "
header, but in those cases where the "To " address, for one reason
or another is not present, then it becomes a project to filter them.
Much easier to just add a header at the forwarding end.
Basically, you want to filter messages by the envelope recipients.
This can't be done, period.  Procmail is a delivery agent, not a MTA, so
Not clear what you are saying above.  Do you mean a header cannot be
added by formail, through a procmail recipe?  Its a bit confusing to
hear: you should "filter messages by envelope recipients".
"Procmail... . doesn't have access to envelope recipients"
It would seem the conclusion would be [ procmail cannot filter messages ]

One common misuse of Procmail is to try this for the "wrong purposes",
but if you are merely looking for something that can say "this came
via foo(_at_)bar(_dot_)com" where you don't really care how it ended up there, 
as
long as it went through the file /home/foo/.procmailrc on bar.com,
nothing could be simpler. Replace this:

    :0
    ! reader(_at_)newsguy(_dot_)com

with this:

    :0
    | formail -I "X-Delivered-Via: foo(_at_)bar(_dot_)com" \
      | $SENDMAIL $SENDMAILFLAGS reader(_at_)newsguy(_dot_)com

... where foo(_at_)bar(_dot_)com is the address whose .procmailrc contains this.

(You can probably modularize this if you want a single file you can
drop in at different accounts, i.e. get the domain name from uname -n
or whatever, and the user name from $LOGIN.)

/* era */

-- 
.obBotBait: It shouldn't even matter whether     <http://www.iki.fi/era/>
I am a resident of the state of Washington. <http://members.xoom.com/procmail/>
 * Sign the European spam petition! <http://www.politik-digital.de/spam/en/> *