How can I reject foreign languages in OSX Mail?
May 2, 2006 12:31 PM   Subscribe

Very simple. How can I set up a rule in apple mail to disregard foreign languages (particularly asian and cyrillic languages)?

I get killed on a daily basis by spam. Apple's Filter hasn't ever done terribly well, I use Spamfire (full baysian) which helps. It stops 80-90% of them from getting through....but I still get 10-30 in my inbox. I know, 100% of the time that the Russian/Chinese/Japanese email is spam.

All I want is a simple rule to chuck those emails. I've tried playing with the ablity to add the charset header (except I think charset is in the body, not the header), as well as just check the entire message for the ISO for the character set, to no avail.

Ideas? Other spam solutions that work for you? But really, how do I set up this rule?

I'm using Mail 2.0.7 (746.2/749.3), part of Tiger 10.4.6
posted by filmgeek to Computers & Internet (8 answers total)
Take a look at the offending emails with full headers. Look for a line like:

Content-Type: text/plain; charset="iso-8859-1"

charset="foo" is your target. There are a number of character sets that are, more or less, "english", and then there are others for specifying Chinese, Japanese, Cyrillic characters, etc. Set up a mail filter that searches the content-type header (or all headers), and dumps email with unwanted character sets. For example, you'll want to dump gb2312 and big5 (Chinese), koi8-r (Russian), euc-kr (Korean) and any other ones you get that annoy you.

I don't know how to use your particular email program but this is not hard to do in most programs. Content-Type is a header, not a part of the email body, which may be your problem.
posted by jellicle at 12:43 PM on May 2, 2006 [1 favorite]

Best answer: Hah. You think it's simple. It's not.

Your best bet is to filter on "Content-Type". This is not one of the headers exposed by default in Mail's rules or in the mail-viewing window, but you can add it as a rule criterion (when defining the rule, pop up the criterion menu, and the last item is "Edit header list..."--choose that). You might want to view full headers on a spam message to see what's going on in there.

You want to pass messages where Content-Type contains "ISO-8859-1 or "US-ASCII" and reject pretty much everything else.

However, this will not account for spam that has been identified (intentionally or otherwise) with the wrong content type. An it forecloses the possibility of seeing mail--even written in English--from someone whose mail client has been configured to send mail as a different encoding type.

Spamassassin (if your mail provider lets you customize it) can be set up to reject mail based on language. I'm not sure, but I think that it does some kind of text analysis, rather than trusting the content-type (which is unreliable).
posted by adamrice at 12:45 PM on May 2, 2006

Best answer: If content-type isn't going to help, why don't you make a rule that searches for particular characters in the body of the email (such as Б)? If you never get any legit Russian mail, that shouldn't give you any false positives.
posted by danb at 12:52 PM on May 2, 2006

I would NOT set up a filter that passes only US-ASCII or ISO-8859-1 encoded emails. You need to do it the other way: filter out just the language encodings that are giving you problems. It takes about two minutes, as described by adamrice.
posted by Mo Nickels at 2:09 PM on May 2, 2006

Response by poster: Yeah, I don't mind filtering bad (vs. only letting by good.)

I created a Header called "Content-Type" and it works...for those that have the correct content type (iso-2022-jp)...along with some other variants...

But realistically, I'm still not happy in the big picture. I need 99.9% spam removal on OSX.
posted by filmgeek at 4:03 PM on May 2, 2006

You can set up a filter to disallow mail that comes from addresses not in your address book. Might that get you closer to 99.9%?
posted by chazlarson at 5:15 PM on May 2, 2006

Response by poster: Chaz, good thoughts, but...

I'm already whitelisting, in several different ways.

I have some 15+ email accounts, and some of my emails are visible on the web for email from strangers (specifically work related.)
posted by filmgeek at 9:27 PM on May 2, 2006

You may wish to attack this problem on another angle. In Preferences > Junk Mail > Advanced the following rule:

If *all* of the following conditions are met:
Sender IS NOT in my Address Book
Sender IS NOT in my Previous Recipients
Message IS NOT addressed to my Full Name
Message IS Junk Mail

Perform the following actions:
Move Message to Trash.
posted by five fresh fish at 10:49 AM on May 3, 2006

« Older What's your favorite waltz?   |   Where to board my dog in Providence Rhode Island? Newer »
This thread is closed to new comments.