procmail
[Top] [All Lists]

Re: Hello & my procmail question...

1995-11-16 09:01:58
At 23:33 11/15/95, LorenD wrote:
I've been using procmail in the following manner:
1.      When someone sends mail to:
               ldelamar(_at_)north-pacific(_dot_)com

2.      It is forwarded (mx record) to the general account:
               norpac01(_at_)teleport(_dot_)com

Be aware that mail addressed to a given recipient may have no indication of
that in the headers.  The two most common examples are mailing lists and
being a Bcc: recipient.

For correctness, you need to have your mail forwarder add the original
envelope recipient information somewhere in the headers.  Common locations
are either an X-Envelope-To: header or as part of a Received: header.

3.      Where procmail is run with the following recipe for each
       user to forward the mail to the to the ugly bang path address.

i:0
* ^To:.*ldelamar
! npl-ptld!ldelamar(_at_)nplptld(_dot_)attmail(_dot_)com

This works fine, but I have to code a near identical recipe for each user.
I would like to have one generic recipe rather than potentially 300:
Is this at all possible ???

Yes, possibly.  It is possible to have procmail do this, as long as the
account names are identical on both systems (i.e.
ldelamar(_at_)north-pacific(_dot_)com is 
npl-ptld!ldelamar(_at_)nplptld(_dot_)attmail(_dot_)com).

However, what happens when mail is addressed to 2 different users at
north-pacific.com?  Does your mail forwarder send just one copy of the
email, or one copy per recipient?

If you just get one copy, then your current scheme is actually the easiest.
Since you know perl, just do a script to create the procmail file.

If one copy per recipient, then you could use the following (untested):
:0
* ^X-Envelope-To:.*\<\/[^(_at_)]+
! npl-ptld!$MATCH(_at_)nplptld(_dot_)attmail(_dot_)com

Good luck!

--Hal
Hal Wine <hal(_at_)dtor(_dot_)com>     voice: 510/482-0597


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