procmail
[Top] [All Lists]

Re: GREPing files in procmail conditions

2003-12-07 04:23:34
On Sun, Dec 07, 2003 at 04:30:05AM +0100, Ralf Hagen wrote:

What I want:
Pseudo-Code:
:0
*^To: {!(grep %mail-recipient% (cut -d: -f 1 /etc/passwd /etc/aliases | 
grep -v '^#'))}
*^X-SPAM-Flag:.*YES
!nobody

Snoopy sleeps in the second line :-(

I don't know what you mean by "Snoopy"; but anyway, going to 
www.procmail.org and to the searchable list archive there and
plugging in to the search field

 /etc/passwd

gets me pretty quickly to this message (of mine) from last
February, which seems relevant:

http://www.xray.mpe.mpg.de/mailing-lists/procmail/2003-02/msg00408.html

Also, you surely would want your second condition to go first.
Thus, you would not be taking the big performance hit on *every*
message, just those marked as spam.


b) What I plan to do - is this a valid way, or too complicated / 
inefficient?

Well, you could run out of LINEBUF space if there are lots of
users in the passwd file.

-- 
dman

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