I have a variety of pattern checks in Postfix as header_checks and body_checks in regex format. As spam slips through, I add key phrases to one or the other of these files so that further similar spam won't get through. I try to pick out strings or phrases that won't be used in ordinary communications but are part of spam messages. Since I haven't been doing this long, I forward the message to myself to test the filter.
I received the following e-mail regarding a scam over the weekend:
I used the following two regex patterns to detect this type of spam:
The first one works perfectly - Starts at the beginning of the line, takes as many spaces as there are, then matches the urgent business crap. I've not been able to get the second one to hit no matter what I do. I've also tried:
and
Neither blocks a message with the given phrase in it, whether I send it in hypertext or plain text. I checked with an online flash-based regex verification tool and it indicated that the first version above should work. I've also used it in vi - hit right away. By this, I have to assume that there's a difference between the postfix regex matching and these other two methods.
Anybody see where I'm going wrong or know of a document that lists the quirks of the postfix body_check regex matching?
I received the following e-mail regarding a scam over the weekend:
Code:
Dear Valued Associate,
REQUEST FOR URGENT BUSINESS RELATIONSHIP
Best compliments of the day. I have a client who wants to invest in your country
with the sum of US$35.5M and he needs protection for his family.If you can handle
such a huge sum of investment please get back to me as soon as possible to discuss,
for example the investment plan and agreement procedure.
Kindly reply if you have any business profile to enable us advise our client
accordingly,and do not forget to include your telephone contacts for easy
communication. Feel free to contact us via email: oberwest@live.co.uk.
Thank you.
OBERHOLSTER WHYTE
I used the following two regex patterns to detect this type of spam:
Code:
/^ *REQUEST FOR URGENT BUSINESS RELATIONSHIP/ REJECT This is an old scam. You might want to try something new. BC07
/I have a client who wants to invest in your country with the sum of US/ REJECT Leave us alone. BC08
The first one works perfectly - Starts at the beginning of the line, takes as many spaces as there are, then matches the urgent business crap. I've not been able to get the second one to hit no matter what I do. I've also tried:
Code:
/^.*I have a client who wants to invest in your country with the sum of US/ REJECT Leave us alone. BC08
and
Code:
/*I have a client who wants to invest in your country with the sum of US/ REJECT Leave us alone. BC08
Neither blocks a message with the given phrase in it, whether I send it in hypertext or plain text. I checked with an online flash-based regex verification tool and it indicated that the first version above should work. I've also used it in vi - hit right away. By this, I have to assume that there's a difference between the postfix regex matching and these other two methods.
Anybody see where I'm going wrong or know of a document that lists the quirks of the postfix body_check regex matching?