[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Here's how to make yourself happier



* David Guntner <david@guntner.com> [14-03/03=Mo 23:46 -0800]:
> Unless you have a reason to want one test per address,
> you could simply put them all in a single test.
>
>> :0:
>> * ^From.*(naturallinux@dcemail.com|arnoldbird@cosmicemail.com|usspookslovesystmd@muchomail.com|fredwln2@mail.ru)
>> $GARBAGE
>
> Collect them all! :-)

I used to construct such recipes like this ...

:0:
* ^From:.*(\
      naturallinux@dcemail.com|\
      arnoldbird@cosmicemail.com|\
      usspookslovesystmd@muchomail.com|\
      fredwln2@mail.ru|\
    DUMMYLINESOIDON'TNEEDTOWORRYABOUTFORGETTINGTHEGODDAMNVERTICALBAR)
$JUNK

... but eventually I started getting "procmail: Exceeded LINEBUF"
so I switched to a hack that uses scoring (`man procmailsc`) to
implement unlimited short-circuited alternation (i.e the testing
stops as soon as a condition is true, and there's no LINEBUF limit):

:0:
* 2147483646^0
* 1^0 ^From:.*naturallinux@dcemail.com
* 1^0 ^From:.*arnoldbird@cosmicemail.com
* 1^0 ^From:.*usspookslovesystmd@muchomail.com
* 1^0 ^From:.*fredwln2@mail.ru
* -2147483646^0
$JUNK

This works on 64-bit as well as 32-bit systems.
Unscored conjuncts can precede the alternatives:

:0:
* !^From:Will Mengarini <seldon@eskimo.com>
* 2147483646^0
* 1^0 ^From:.*naturallinux@dcemail.com
* 1^0 ^From:.*arnoldbird@cosmicemail.com
* 1^0 ^From:.*usspookslovesystmd@muchomail.com
* 1^0 ^From:.*fredwln2@mail.ru
* -2147483646^0
$JUNK

-- 
                 Will Mengarini  <seldon@eskimo.com>
         Free software: the Source will be with you, always.
   O< ASCII ribbon campaign - stop HTML mail - www.asciiribbon.org


Reply to: