procmail
[Top] [All Lists]

Re: URGENT PLEE FOR HELP!

1996-08-14 15:13:55
pmlabrier(_at_)pobox(_dot_)com (Paul LaBrier) writes:
...
What I need to accomplish is this,  sort and deliver mail to the users
of our LAN, eliminate duplicates (this is important, alot of mail to
our office is sent to everyone in the office, with all e-mail
addresses in the To: field)  send all junk to a ficticious user named
mailbag.

So if a piece of mail is addresses to two users, who should get it?
Only one?  Both?  Neither (give it to mailbag)?


....
==========================================================
/etc/procmailrc
==========================================================
LOGFILE=/var/spool/mail/procmail.log
VERBOSE=yes
LOGABSTRACT=all

:0:c
* ^TO:.*pmlabrier@
!pml


There are four errors here:
1) The "^TO" token is magic, and should be followed immeadiately by the
   address to be matched, in this case 'pmlabrier'.  The ":.*" is
   unwanted, as the expansion of ^TO includes something similar, but
   better.  As is, there have to be two colons for it to match.  The
   '@' is a good idea though.
2) If you only want mail that's addressed to multiple people to go to
   one person, then you don't want the 'c' flag on this or any of the
   following recipes, as otherwise it will go to multiple people,
   surprise.
3) If you _did_ want the 'c' flag, it should go before the second
   colon, right after the zero.  Everything after the colon is
   interpreted as the name of a locallockfile for this recipe.
4) Actually, you don't need a locallockfile on this recipe anyway:
   forwarding recipes ('!') are safe in this way.

(I'm not trying to be harsh.  I just don't want you to come away with
your problem fixed, only to make one of the above mistakes at a later
time.)

So the recipe should look like:

:0
* ^TOpmlabrier@
!pml


If the scrunching of "^TO" and "pmlabrier" bothers you, then you can
seperate them with parens:

:0
* ^TO()pmlabrier@
!pml


If you make the same sort of changes to the other recipes then you'll
end up with a situation where a message sent to multiple people will
go to the person mentioned the earlier in the .procmailrc.  This may be
what you want.  If it isn't, then you should think really carefully how
to _algorithmicly_ decide where a message addressed to multiple people
should go.

Philip Guenther

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