procmail
[Top] [All Lists]

RE: efficiency and LINEBUF

2001-03-30 09:30:01

Timothy asked,

| Assume CELLWHITELIST has less than 200 entries in it... one line per
|
| * $   ^To:.*$ME
| * $ ! ^From:.*$ME
| * ?    test -f $CELL_FORWARD
| * ?    fgrep -is "$REPLYTO" $CELLWHITELIST

| What is the most efficient order to put the following conditions in?

Put the one that would eliminate the most messages first, of course.


Well, that depends on a few things.

If the file CELL_FORWARD is not there, that will stop them all... however that
is most often there, so there will not be many times when it isn't true... so it
won't actually stop many messages in practice.

If the address isn't found in the CELLWHITELIST then it doesn't matter if it is
To: me or not

etc


Let me put it another way:

which is more efficient:
1) Calling an external program (test/fgrep) or
2) expanding a variable ($ME)

If calling the external program is "heavier" than expanding the variables, then
it would make sense to have the external programs after the variables in a
certain order.... i.e. I assume that checking for a file's existence is easier
than fgrep'ing another file.

I would also assume that the ^To: and ^From: lines are about equally "weighty"
but assuming that I get more email from others To: me rather than messages I
send myself, it would make more sense to have the ^To: first.


Thanks
TjL

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