procmail
[Top] [All Lists]

Re: Delivered-To: [adding it]

1999-06-16 19:34:21
On 16 June 1999, 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 it doesn't have access to envelope recipients.
By the time the message gets to procmail the envelope recipients are
already lost.

Not clear what you are saying above.  Do you mean a header cannot be
added by formail, through a procmail recipe?

    No.  I was just trying to say the addresses you want to filter by
are not available to procmail.  They are part of the SMTP negotiation,
and as such they are entirely handled by sendmail, procmail doesn't get
to "see" them.

Its a bit confusing to hear: you should "filter messages by envelope
recipients".

    Actually, I said filtering by envelope recipients is what you were
asking for, not that you _should_ do it.  My point was you _can't_ do
it.

"Procmail... . doesn't have access to envelope recipients" It would
seem the conclusion would be [ procmail cannot filter messages ] I
know thats not what is meant here.

    Even without it, messing with "Delivered-To:" and / or relying
on its contents is a bad idea.  Some MTAs out there (QMail and
Postfix come to mind) use that header for detecting mail loops, and
they might add such headers for messages in transit.

Is there a neutral header option that could be added in this situation
that doesn't cause other problems, but would make the messages easily
identifiable as to where they came from?

    You can use any name you like that starts with "X-".

I realize "Recieved" headers do this, but not in an easily parsed
manner.

    The format of "Recieved" headers varies from one MTA to another.  It
usually doesn't contain any information about recipients.

I want to do this:

[Incoming Internet mail] ==> [Machine 1 forwards to] => [machine 2]

At machine1 add, something innocuous to make mail easily identifiable
at machine 2.  So that recipient[s] at machine 2 can tell the mail was
first delivered to machine 1.

    Ok, that's a completely different problem than your initial question
--- and it has nothing to do with procmail.  Basically, you need some
ugly (and quite inefficient) hacks to sendmail rewriting rules.  I never
tried that myself, but people claim to have found valuable informations
about that on:

        http://satan.oih.rwth-aachen.de/AMaViS/FAQ.txt

Apparently it's a FAQ about filtering messages "in transit".  People
seem to be using that for killing viruses (Melissa and the like), but
you can use it for adding your tag header.

    Regards,

    Liviu Daia

-- 
Dr. Liviu Daia               e-mail:   Liviu(_dot_)Daia(_at_)imar(_dot_)ro
Institute of Mathematics     web page: http://www.imar.ro/~daia
of the Romanian Academy      PGP key:  http://www.imar.ro/~daia/daia.asc