procmail
[Top] [All Lists]

Re: global procmail rules before .forward

2003-03-28 19:02:40
At 16:52 2003-03-28 -0700, Ross Simpson did say:
In researching this, the only answer I found was to move from a .forward
file to a .procmailrc file in each of the affected users' home
directory, and then put whatever rules I wanted to in there.

But, as I said, I don't want to do this.  I'd like to have incoming mail
for that set of users be processed by procmail, then be forwarded on to
the fowarding address.

I don't follow why /etc/procmailrc isn't appropriate for your purposes:

:0
* LOGNAME ?? ^^(user1|user2|user3|user4)^^
{
        # do whatever that is global to this subset of special users
}

I've detailed a variety of methods which can be used to flag specific users as members of a certain group for filtering purposes. Using an "opt-in" type of file in their home directory, creating system _groups_ (in the /etc/groups file), where the admin can add and remove them, or any number of database functions (even a flat text file) which you can query. /etc/procmailrc is the appropriate place to perform _global_ operations for a group of users, even if it isn't EVERY user of a system.

If the users don't _really_ have a local accounts (your reference to forwarding, gives me the impression that these users might not otherwise exist as locals on your mail server), then you should consider using /etc/mail/aliases to invoke procmail manually for those individual user identities:


someuserid: "|/usr/local/bin/procmail -m /etc/procmailrcs/specialuserfile.rc someuserid"

(all one alias line, replicate for each individual you're doing this fun stuff for)

Create your /etc/procmailrcs/specialuserfile.rc file and have it do what you need it to do (keeping in mind that you'll need to explicitly declare some variables to ensure they're set to what you want them to be, and the file should be owned by some script user you set up to do this sort of thing). $1 will contain that someuserid bit, in case the rcfile might need that bit of information.

See 'man procmail'.

---
 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

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