procmail
[Top] [All Lists]

RE: new user: what am I doing wrong with this recipe?

2002-09-16 17:15:25
Thanks to everyone for help on this.

Learning from examples posted, this is what I finally came up with in order
to distinguish Japanese mail from non-Japanese mail, and sent the
non-Japanese mail to spamassassin:

:0f
* 9876543210^0
(iso-2022-jp|jis.C6220|JIS_C622[0-9]|jis.x0201|shift.jis|windows.31j)
| formail -I "X-Japanese-Message: Yes"
:0f E
* 9876543210^0 B ??
(iso-2022-jp|jis.C6220|JIS_C622[0-9]|jis.x0201|shift.jis|windows.31j)
| formail -I "X-Japanese-Message: Yes"

:0fw E
* !^X-Japanese-Message: Yes
|/usr/local/bin/spamassassin -P

:0:
* ^X-Spam-Status: Yes
$HOME/spam

I decided that the regex (thanks Bob) could be simplified from the
Spambouncer example, because it is unlikely that mail originating from a
non-Japanese source would have any of the strings above. I needed to check
the body of the mail as well, because Outlook, and possible other clients,
send rich text messages by default, and the Japanese encoding type
definition is only found in the body of the text, not the header.  Parv gave
me a sense that checking the body of the mail could be expensive in terms of
processing burden, so I constructed this to first look for the Japanese tags
in the header, and only further look in the body if the header shows no
hints of Japanese. This also gave me an example of how I might use variables
in the recipe, but I thought I would just try the formail function to add a
definitive tag to the header.

If I come up with something smarter, I will post it to the list for archive
purposes.

Bill



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail