procmail
[Top] [All Lists]

Re: Recipe problem

2004-08-26 07:22:08
On Thu, Aug 26, 2004 at 12:46:07AM -0400, Bob George wrote:
Chuck Campbell wrote:

[...]
:0
* (^TO|^TO_|^Sender:|^X-list:|^FROM_DAEMON|^From:.*)linux-xfs

I seem to recall problems matching the ^TO macro as part of a list. 
Perhaps a scoring rule like (untested):

:0:
* 1^0 ^TOlinux-xfs
* 1^0 ^TO_linux-xfs
* 1^0 ^Sender: .*linux-xfs.
* 1^0 ^X-list: .*linux-xfs
* 1^0 FROM_DAEMONlinux-xfs
* 1^0 ^From: .*linux-xfs
{
 :0 c:
 list_ham
 :0:
 linux-xfs
}

or some other variation to keep the macros separate from other tested 
values?

I'm certainly learning more than I thought :-)

Does the scored version of the recipe run faster than the ORed version?
I assume something with huge scores would abort the rest of the work, like 
this:

:0:
* 9876543210^0 ^TOlinux-xfs
* 9876543210^0 ^TO_linux-xfs
* 9876543210^0 ^Sender:.*linux-xfs
* 9876543210^0 ^X-list:.*linux-xfs
* 9876543210^0 ^FROM_DAEMONlinux-xfs
* 9876543210^0 ^From:.*linux-xfs
{
    LISTNAME=$MATCH
}
:0E
* ! LISTNAME ?? ^^^^
{
 :0 c:
 list_ham
 :0:
 linux-xfs
}

Am I correct in assuming the the first "hit" on any of the conditions
would set a score larger than procmail's infinity, and skip the rest?

Is that actually different than this condition:
* (^TO|^TO_|^Sender:|^X-list:|^FROM_DAEMON|^From:.*)linux-xfs
in that to truly evaluate it, it must check all 6 conditions, while the scored
version can terminate as soon as a match is found?


I could see a problem if the matched portion of the list name were to 
change, as you'd wind up with two mboxen: one for the old name, and one 
for the new.

Which leads me to the rest of the (story) recipe I'm actually trying to 
finish.  Mapping the $MATCHed part to the correct folder names.

i.e.:
spamassasin-users is filed in folder sa
satalk is filed in folder sa
redhat-install-list, redhat-users and fedora-list are all filed in folder rh
linux-kernel is filed in folder lkml

etc...

I am working out how to "map" from a matched LISTNAME to an appropriate folder
name.

Note, I'm not asking for this, I'm working on it.  When I get into trouble,
I'll ask for help :-)

-chuck

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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