procmail
[Top] [All Lists]

Re: Recipe efficiency

2003-02-16 15:20:56

Hi Richard. Calling external programs is probably not the most
efficient way. One could use something like:

    :0:
    * ^subject:.*[-ÿ][-ÿ][-ÿ]
    ascii_subject_problem

as a procmail conditional, where three characters with values of 128
to 255 in succession are required to reject a message. (The reason for
three is that some MUAs use high order ASCII for single and double
quotes in the subject line of legitimate e-mail.)

        John

BTW, making the 128-255 value ASCII characters can be problematical
with some text editors that you might be using for editing
~/.procmailrc, So, cut-and-stick/string copy the above characters as
needed. You will probably want to look for high-order ASCII characters
in the return address, too-which is often used in spam from Taiwan and
Korea. So an efficient conditional would look like:

    :0:
    * 2147483647^0 ^subject:.*[-ÿ][-ÿ][-ÿ]
    * 2147483647^0 ^content-type:.*charset=.*(euc-kr|ks_c_5601-1987)
    * 2147483647^0 ^((reply|errors)-to|from|(return-)?path|return-receipt-to|\
       sender|resent-(from|reply-to|sender)):.*[-ÿ]
    ascii_problem

which would detect e-mail with Korean character sets, too. (The
2147483647^0 is a logical "if" construct-if any condition is true,
then the procmail conditional score is true, and equal to 2147483647;
as soon as the score is 2147483647, no further conditions will be
tested. See the MISCELLANEOUS section at the bottom of "man
procmailsc" for particulars.)

Dick Adams writes:
I've been getting spam containing ascii characters in the range
of 128 to 255.  The recipe I am using follows.  My question is:
Is this efficient or inefficiency?  Is there notably more
efficient alternative.

-- 

John Conover, conover(_at_)rahul(_dot_)net, http://www.rahul.net/~conover

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