PDA

View Full Version : Need help with .cn spam


asjawebmaster
10-22-2009, 02:15 AM
We are getting flooded with html spam that contains the cn TLD in a link. Eg:

abcde.cn

Will this filter work?

if grep -iq '.cn'; then exit 99; fi

what I'm concerned about is the period before cn affecting the script in a manner that I don't understand and wiping out good emails.

Any thoughts?

Bruce
10-22-2009, 09:51 AM
Will this filter work?

if grep -iq '.cn'; then exit 99; fiThat will block any message having the string "cn" in it not at the start of a line (the "." is interpreted as "any one character"). You probably want something like the following:if grep -iq '\.cn["/]'; then exit 99; fiThis will match the literal strings '.cn"' (for things like '<a href="http://foo.cn">') and '.cn/' (for things like 'http://foo.cn/blah'). If those strings appear in an innocuous message, though, it will be silently dropped just the same as the Chinese spam.

manfred
10-22-2009, 11:11 AM
Hello Bruce,

I've tried your code suggestion but your filter is deleting all the informations from the email. If I send an email to the protected address, the mail was sent from "Unknown" with no subject.

-Manfred

Bruce
10-22-2009, 12:01 PM
The only way that recipe should be able to modify the content at all is if it was installed as a "processor" instead of a "simple filter". I see a similar custom filter recipe installed on one of your domains now but with a typo that will cause all mail to that mailbox be deferred (note the unbalanced quotes):if grep -iq .cn'; then exit 99; fiAm I looking at the right domain?

asjawebmaster
10-22-2009, 02:26 PM
I did try the simple filter as I posted on a test account and it was killing all incoming email.

I used Bruce Guenter's suggestion (thank you very much) and so far test emails are getting through. Will do a bit more testing.

And of course, the .cn spam has subsided for the moment . . .

manfred
10-23-2009, 02:34 AM
Ahhh, my mistake. I did install it as a "processor". Thank you Bruce :)