[X4U] Filtering foreign messages in Mail.app

DZ-Jay dz at caribe.net
Sun Jul 31 04:44:26 PDT 2005


Hello:
	I receive a lot of spam with foreign character encoding (foreign to 
me, an American), such as Russian, Japanese, and Chinese.  I would like 
to create a filter to catch these and delete them directly, since there 
is no chance I will ever receive any message in these languages that is 
legit (and if I did, I wouldn't be able to understand it anyway.)

	I set a filter to search the Content-Type header for the string 
"charset=xxxx" (where xxxx is GB2312, windows-1251, koi8, ISO-2022, 
which seem to be the most common ones I get.)  The problem is that a 
lot of messages do not contain the character set in the main headers, 
but in the Content-Type headers of each specific MIME part.  They do, 
however, contain a Quoted-Printable-like encoded string in the Subject 
and From lines, and these strings begin with the character set 
definition, as "=?GB2312?...", etc.  But I cannot seem to be able to 
match these strings, since apparently Mail.app decodes the headers 
prior to filtering (which is great for those trying to filter in their 
native tongue, but bad news for those trying to check the raw headers.)

	Is there a way that I can filter the raw headers, prior to encoding?  
Or is there any other way I can catch these particular foreign 
messages?

	Thanks in advance!

	dZ.

-- 
Pound! Bang! Bin! Bash! is this a shell script or a Batman comic?!



More information about the X4U mailing list