procmail
[Top] [All Lists]

Re: CC and other routing problems

1998-11-14 11:06:22
era eriksson <era(_at_)iki(_dot_)fi> writes:
...
2. Procmail can only act on what's in a message (headers or body) or
   on parameters set on its command line. This means that Procmail
   can handle BCC: and other variations of this scheme correctly,
   given one of the following conditions:

     * The envelope recipient is passed to Procmail as a parameter.
       This is possible and even normal if Procmail is your local MDA

Not really.  When procmail is the local mailer under sendmail, for
instance, $1 (set using the -a argument) is set to whatever is after
the '+' when a 'plus address' was used, not to the envelope recipient.
You cannot tell if the mail was routed to you through an alias.  For
example, if root(_at_)gac(_dot_)edu was subscribed to a mailing list then I 
would
get the message, but without any indicator that root was the one
subscribed and not I.  Only the sendmail log files would show it.

Now, if you're invoking sendmail's procmail mailer (which calls
procmail the program with the -m flag) then there procmail is being
passed both the envelope recipient and envelope sender.  Normal
aliases can't just forward messages to the procmail mailer -- you
have to use something like the mailertable for that.


     * The envelope recipient is passed to Procmail by being written
       into the headers by your MTA, as in X-Envelope-To:, or
       Apparently-To:, or one of the other hacks people use. This
       isn't very hard to do with a configurable MTA per se, but most
       configurable MTA:s out there are in and of themselves not very
       simple to configure ...

3. You can pretend to get along by simply ignoring the above facts,
   and create a bigger problem than you had to start with by trying
   to kludge around the problems that inevitably crop up by and by,
   as you encounter them. This has proven to be an incredibly popular
   option. Granted, a lot of the time a lot of the information you
   need is coincidentally in the headers, and some fairly big sites
   who ought to know better are relying on this for mail delivery.

For example, fetchmail, I believe, rather successfully uses #3. You
can try to emulate its behavior in Procmail, but it's fairly hairy,
and some of its heuristics are rather hard to code in Procmail.

Fetchmail would prefer to look for the recipient address(es) in a
specified header (i.e., the last part of #2), but since many places
can't or won't do that, it's probably stuck doing #3 most of the time.


Philip Guenther

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