procmail
[Top] [All Lists]

Re: exclude a local user from anti-spam/virus procmail testing.

2004-05-07 09:16:43
At 12:42 2004-05-06 +0300, Udi Mottelo wrote:
On Wed, 5 May 2004, Professional Software Engineering wrote:

> At 16:10 2004-05-05 -0700, Professional Software Engineering wrote:
> >At 23:50 2004-05-05 +0200, Jostein Berntsen wrote:
> >>What about having this first in your global procmailrc:
> >>
> [...]
>
> GROUPS=`groups $LOGNAME`
>
> # if user is a member of the nospam group, subject them to filtering
> :0
> * GROUPS ?? [   ]nospam\>

        Sean, are you sure about the  "[  ]"?  the name can be
        in the beginning of the line.  Maybe:

You are correct, on BSD, the output of groups lacks a preceeding userid field. The host on which I use this particular approach displays the username followed by the group names, and thus this approach has worked (and by merit of requiring the leading whitespace, doesn't treat the username as a potential group name just in case there's a name collision).

* GROUPS ?? ()\<nospam\>

That would seem to be a suitable solution for BSD-ish groups output.

Alternatively, after setting groups, and before the recipe:

GROUPS=" $GROUPS "

Would insert a leading AND trailing space to the string. One could add that if you're running a system which emits group data without a leading username. Then modify the regexp I provided to look for trailing whitespace instead of a wordbreak.

Note that I've never bothered using a group name with hypens in it, but that can trip up the \> regexp (incl. at the END of the one I specified), but you'd have to both use hyphens AND have a group name which had a corresponding hyphenated form: nospam and nospam-web or somesuch.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail