procmail
[Top] [All Lists]

Re: Help w/alias & receiving mail from a listserver

1997-11-26 18:56:40
At 05:36 PM 11/26/97 -0600, Troy Robbins wrote:

:0 E
* ^TO_frank
! frank(_at_)realprovider(_dot_)com

You _might_ get into the habit of specifying your domain:

$MYDOMAINPART=naifa.com

:0 E
* $ ^TO_frank(_at_)$MYDOMAINPART

This should make sure you don't pick up on mail that just happens to
contain FRANK in the address list.  Or "Frank" vs "FrankA" vs "FrankB", etc.

The above is working fine unless frank subscribes to a listserver, how
does one work around this ?  Any help would be greatly appreciated as
I'm a struggling newbie.

There are things for which Procmail is well suited, and there are things
for which it isn't.  Sendmail (newer versions at least) handles aliasing
quite well (and with even less system load).  You want to check
/etc/aliases or (if virtual hosting multiple sub/domains), possibly
/etc/virtualusers.txt.  It rather depends on the sendmail config.

IF procmail is being invoked by sendmail, and it is set up with mailertable
support properly, $1 and $2 should be giving you access to the sender
(FROM) and recipient (RCPT), respectively (you've got to copy them to
another variable before use though).  But if it isn't (and say, you're
invoking using a .forward file), then these variables are empty.

Thing is, ^TO should catch those few instances where the recipient's
address appears in a received header.  Unfortunatley, the moment a second
user subscribes, you're likely to lose that information (and then, if the
user wasn't blind carboned, BOTH copies would be going to the FIRST person
being filtered).

How one works around this is generally by using the features in sendmail
geared towards forwarding mail for specific addresses (see /etc/aliases),
and completely skip using procmail _for_forward_aliases_.  I know - I
wanted to do this very thing once, but the problem is that if the message
isn't always addressed TO a specific user, Procmail can't consistently
parse it as being FOR that user.

---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395

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