1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Is there a way to block a message by a specific email SUBJECT?

Discussion in 'Plesk for Linux - 8.x and Older' started by ZaNaToS, Apr 10, 2007.

  1. ZaNaToS

    ZaNaToS Guest

    0
     
    I/ve red the following article in the kb of swsoft about blocking emails in spamassassin depending on what they contain in the subject : http://kb.swsoft.com/article_123_1038_en.html


    Custom filter rules can be defined in /etc/mail/spamassassin/local.cf, for example:

    header CUSTOM_SUPERSPAM Subject =~ /.*spam subject.*/i
    describe CUSTOM_SUPERSPAM Superspam messages
    score CUSTOM_SUPERSPAM 100.0

    I've tried that, for example with this:

    header CUSTOM_SUPERSPAM Subject =~ /.*viagra.*/i

    and it worked fine, my question is, how can I add multiple different subjects? (many words or phrases ?)
     
  2. atomicturtle

    atomicturtle Golden Pleskian

    29
     
    Joined:
    Nov 20, 2002
    Messages:
    2,110
    Likes Received:
    7
    Location:
    Washington, DC
    Theres more that one way to do it, but an easy way would be to expand your regular expression:

    header CUSTOM_SUPERSPAM Subject =~ /.*(viagra|levitra|calis).*/i

    that would match (case insensitive) against the words viagra, levitra, or calis anywhere in the subject line.
     
  3. ZaNaToS

    ZaNaToS Guest

    0
     
    thank you very much, what could be the other ways ?

    could I give it a variable that would open a "text" file with all the forbidden words?
     
  4. atomicturtle

    atomicturtle Golden Pleskian

    29
     
    Joined:
    Nov 20, 2002
    Messages:
    2,110
    Likes Received:
    7
    Location:
    Washington, DC
    Bayes would be the other method in I would use in Spamassassin. You'd want to train it against those messages that otherwise arent being missed. qmail-scanner has the ability to block messages by the subject line, viagra is one of the rules it has on by default. Otherwise you'd want to augment your SA installation with other tools, like pyzor, dcc and razor if you havent already.
     
  5. djtech2k

    djtech2k Guest

    0
     
    I am in need of the same solution. I have tried the above custom rule with spamassassin as well as modifying the ".qmail" files, but nothing works.

    With the spamassassin config, here is my config:

    Code:
    required_hits   3
    rewrite_subject 1
    subject_tag     *****SPAM*****
    report_safe 0
    
    header CUSTOM_SUPERSPAM Subject =~ /.*(viagra|levitra|cialis).*/i
    describe CUSTOM_SUPERSPAM Superspam messages
    score CUSTOM_SUPERSPAM 100.0
    
    I have this exact same config in my local.cf as well as in my email user's user_prefs. If I send an email with any of those in the subject, it still passes.

    Any ideas?
     
  6. djtech2k

    djtech2k Guest

    0
     
    BTW, I checked my spamassassin version and it is 2.6.3. I am on plesk 7.5.4.
     
  7. djtech2k

    djtech2k Guest

    0
     
    I just realized that I have to enable spamassassin for each user in plesk. Some things are getting blocked, but I need to add some subject checking. I have added this:

    Code:
    required_hits	6
    rewrite_subject	1
    subject_tag	*****SPAM*****
    report_safe 0
    
    header CUSTOM_SUPERSPAM Subject =~ /.*(viagra|The United States National Medical Association|cialis).*/i
    describe CUSTOM_SUPERSPAM Superspam messages
    score CUSTOM_SUPERSPAM 100.0
    

    I added it to my local.cf, and BOTH user_prefs files. Yes, I suddenly have 2 of them in 2 different places for my user. I have plesk set to use server wide settings AND personal settings. I have my user set to use server settings.

    I am baffled!!!!
     
Loading...