Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 468
  • Last Modified:

Spam filtering issue

Dear Experts,

I am running Sendmail with MailScanner on a Redhat Linux ES 3.0. I would like to know if it is possible to setup a Spam filtering to scan for certain "Text" within the message body such: Viagra, cialis, ... If so please give me some instruction on how to approach the seting.

Thank you for your help
vltnson  
0
vltnson
Asked:
vltnson
  • 9
  • 5
  • 3
2 Solutions
 
vltnsonAuthor Commented:
Dear Site Administrator,

No one is able to help resolving this question so please delete and refund the point

Thank you
0
 
jlevieCommented:
Are you using a current version of SpamAssassin with MailScanner? It should catch most of those emails and flag them with a SpamScore. And, you can add custom rules to SpamAssassin for those keywords.
0
 
vltnsonAuthor Commented:
Thank you Jlevie for your respond.

Yes I am using a current version of SpamAssassin with MailScanner. I just downloaded MailScanner and installed onto one of my servers about two weeks ago, and it works just fine. The SpamAssassin came with my Linux ES 3.0 Update 4, I think that is pretty current version.  I don't know much about SpamAssassin neither MailScanner, could you please kindly lead me through to add custom rules to my SpammAssassin.  I couldn't stand spam emails we are getting. I couldn't block them in the /etc/mail/access because every time they come into our mail server they barried themselves in different return addresses.  

I am very appreciate your time to help me resolving this problem.
vltnson  
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jlevieCommented:
The copy of SpamAssassin that's included with RHEL (v2.55) is quite old. The current version of SpamAssassin is 3.03. Acordingly I never use the RHEL package with MailScanner. What I do is to remove RedHat's spamassassin and build a fresh copy from sources. You'll also find that adding some of the better DNS black lists to your sendmail config will help lots in controlling Spam. I use:

FEATURE(`dnsbl', `rbl-plus.mail-abuse.org')dnl
FEATURE(`dnsbl', `relays.ordb.org')dnl
FEATURE(`dnsbl', `dnsbl.sorbs.net')dnl

in sendmail.mc to reject connections from blacklisted sources. Note that rbl-plus.mail-abuse.org is a commercial only blacklist, but it well worth the money. The other two are free.
0
 
vltnsonAuthor Commented:
I already had some of those FEATUREs imbeded in my sendmail.mc file and they are work pretty good.  What I want to do now is to setup the rules for SpamAssassin so that it could scan for sensitive words such as: Viagra, Cialis... Is it posible to do this?
0
 
jlevieCommented:
Yeah, you can add rules to /etc/MailScanner/spam.assassin.prefs.conf. There's some examples towards the end of that file and you can look at the SpamAssassin rule sets for more examples.
0
 
vltnsonAuthor Commented:
I make some changes to my spam.assassin.prefs.conf but it is not doing the job I am asking for.  This is what I have done:

                                                                                                                                               
header   FRIEND_GREETINGS       Subject =~ /you have an E-Card from/i
describe FRIEND_GREETINGS       Nasty E-card from FriendGreetings.com
score    FRIEND_GREETINGS       100.0
header   FRIEND_GREETINGS2      Subject =~ /you have a greeting card from/i
describe FRIEND_GREETINGS2      Nasty E-card from FriendGreetings.com
score    FRIEND_GREETINGS2      100.0
header   FRIEND_GREETINGS2      Subject =~ /Viagra Cialis/i
describe FRIEND_GREETINGS2      Filter for unwanted spam
score    FRIEND_GREETINGS2      100.0


                                                                                                                                               
0
 
vltnsonAuthor Commented:
hi Jlevie,

The example I posted above doesn't work according to what I need. I am still seeing those emails come through the server. Do you have any better code I may use?

Thank for your help
0
 
townsepwCommented:
You also need to go to http://www.rulesemporium.com/.  They have tons of custom rule sets there written for SpamAssassin that will help you filter out a lot of the common junk.  We are running Spamassassin 2.63 with several of the rule sets from there and our spam has been reduced drasticallly.  
0
 
townsepwCommented:
Oh yeah, forgot to add that you should add those rule sets to /etc/mail/spamassassin/
0
 
vltnsonAuthor Commented:
I am still getting a lot of spam on my server eventhough I have Mailscanner installed an actived.  As I memtioned above I need to filter out emails that contain specific "text".  If someone could give me some example I'll be appreciate that.  This is what I had tried but it wasn't do any good...

header   FRIEND_GREETINGS2      Subject =~ /Viagra, Cialis/i
describe FRIEND_GREETINGS2      Filter for unwanted spam
score    FRIEND_GREETINGS2      100.0

Please help...
0
 
jlevieCommented:
The spamassassin rules are using Perl regular expressions, so what you have above would only match a Subject that contained exactly "Viagra, Cialis" (case insensitive). To match either of those to words in a Subject you'd need to use:

Subject =~ /Viagra|Cialis/i
0
 
vltnsonAuthor Commented:
Thank you jlevie for your responding.  I have been trying to setup this spam filter for a while now but I was unsuccessfully atempted. If you could give me some more instructions on how to setup a spam filter that would scan the "body" rather than the "subject" of an email for those sensitive words such as: viagra | Cialis... I would be very much appreciate that.

Thank you
0
 
townsepwCommented:
So, vltnson, can you do anything for yourself?  Have you ever tried searching for something on your own on the Internet?  Mailscanner with spamassassin is pretty easy to figure out and there is a ton of online documentation about it.  
Besides, you will NOT be able to write all the rules you need in order for your spam filter to be successful.  You will need to download a couple rulesets in order for it to be effective.  Don't worry, they're free.  

Rule Writing Basics
http://www.exit0.us/index.php?pagename=RulesBasics

Google:  spamassassin rules
0
 
vltnsonAuthor Commented:
I tried Subject=~ /Viagra|Cialis/i  and sent a test message with the subject contains "Viagra" it still gets through my server.  Do I need to restart any services to have this spam filter takes effect?
0
 
jlevieCommented:
You would need to restart Mailscanner for it to read the changed config file.
0
 
vltnsonAuthor Commented:
Jlevie, Thank you for all your help.  I got a few pretty useful link that townsepw posted above.  I based on those examples to apply to the ruleset and they work like a charm.    
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 9
  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now