procmail rule

I can tell this is not a recently active formum, but here goes, "why doesn't this procmail rule block
messages with v�agra or v1agra appearing in
the subject header

:0

  • ^Subject:.*(v�agra�v1agra�p�nis�prescripti0n�Medicati0n�M0rtgage�Xanaxz)
    {
    LOG="(THE 7 DIRTY WORDS) "
    :0
    /dev/null
    }

Waaaay down at the end of this procmail tutorial is a section called "Permanently deleting mail".

Not sure if this'll work for you or not, but their suggestion is:

:0:
* ^Subject:.*(word1�word2�word3) /dev/null

They do something similar in the University of California at Berkeley's Procmail Tutorial

######
# Rule 1: discard all mail send from SPAMSITE.COM or 
# with ADV in the subject
######
:0
* ^From:.*SPAMSITE.COM
* ^Subject:.* ADV.*
/dev/null

I'm not able to test any of this, so I don't know why your code isn't working correctly... maybe the braces? Maybe the second :0 ?

[rephrased question: how do you filter 8-bit characters in the subject header via procmail?

It cooks on the � which I believe to be an extended ASCII 161
Note that is an 8-bit character.

This rule breaks on a message with Subject: v�agra

:0

  • ^Subject:.*(v�agra�v1agra�p�nis�prescripti0n�Medicati0n�M0rtgage�Xanaxz)
    {
    LOG="(THE 7 DIRTY WORDS) "
    :0
    /dev/null
    }

[procmailLOG] --note the Subject header is garbage.
From jones@justjones.edu Thu Feb 12 21:10:19 2004
Subject: =?ISO-8859-1?Q?Fwd:_v=EDagra?=
Folder: /var/spool/mail/jones

This rule works [7-bit ASCII only] with Subject: v1agra

:0

  • ^Subject:.*(v1agra�prescripti0n�Medicati0n�M0rtgage�Xanaxz)
    {
    LOG="(THE 7 DIRTY WORDS --) "
    :0
    /dev/null
    }

[procmailLOG]
(THE 7 DIRTY WORDS) From jones@justjones.edu Thu Feb 12 21:03:30 2004
Subject: Fwd: v1agra
Folder: /dev/null

for the record, the word has to be spelled wrong to get on my
7 dirty words list note the zeros insted of O's in prescript0n
reference George Carlin, 1970's, "The 7 Dirty Words"
v\�agra doesn't work either.

i believe it is becuase it is an extended char.

if your filter can understand octal or hex you might have a better chance.

or if you can define a new char encodeing for proc mail then you will be set.

This one works. Apparently that character "�" was an extended ASCII 237 0xED This is procmail-3.22-5

:0

  • ^Subject:.*(v=EDagra|v=ECagra|v1agra|V\*iagra|V1\@gra|Prescripti0n�M0rtgage)
    {
    LOG="(THE 7 DIRTY WORDS) "
    :0
    /dev/null
    }