The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

spam

Discussion in 'General Discussion' started by blaze64, Aug 27, 2003.

  1. blaze64

    blaze64 Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    16
    Just wondering if there is a way to add certain words or phrases to the /etc/antivirus.exim file?

    I am trying to curb spam and there obviously certain words that are good to include, such as Viagra... or penis enlargement.

    Is there a way to do this? GLOBAL???

    cPanel.net Support Ticket Number:
     
  2. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Sure, this is easy enough to do. You can use normal filtering in the antivirus.exim file. Simply scroll down just under the following lines:
    Code:
    if not first_delivery
    then
      finish
    endif
    and enter something like this:
    Code:
    if $header_subject: contains "viagra" or
       $header_subject: contains "porno"
        then
            fail text "This email contains bad words."
            seen finish
    endif
    cPanel.net Support Ticket Number:
     
  3. mjm

    mjm BANNED

    Joined:
    Aug 1, 2003
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    what about v1agra? or vi4gra? or p0rno?

    there are too many variants to just use simple word matching.

    cPanel.net Support Ticket Number:
     
  4. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    The variables are expandable. i.e.

    [v|V][i|I|1]agra

    cPanel.net Support Ticket Number:
     
  5. blaze64

    blaze64 Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    16
    LIKE THIS???



    if $header_subject: contains "[v|V][i|I|1]agra" or
    $header_subject: contains "porno"
    then
    fail text "This email contains bad words."
    seen finish
    endif

    cPanel.net Support Ticket Number:
     
  6. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    That's right.

    cPanel.net Support Ticket Number:
     
  7. blaze64

    blaze64 Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    16
    The below works, but if I add a second $header line, to stops working, and the error is something like "unexpected ...."

    if $header_subject: contains "porno"
    then
    fail text "This email contains bad words."
    seen finish
    endif


    Any way to get rid of multiple words? I tried "porno, virega" but seperating with commas gives errors as well.

    cPanel.net Support Ticket Number:
     
  8. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Look at my example above. You need to include the word "or" after a line if you want to scan for more words, etc.

    cPanel.net Support Ticket Number:
     
  9. blaze64

    blaze64 Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    16
    OK... if I put the below in, it only blocks the word viagra, but NOT monkey.


    if $header_subject: contains "viagra" or
    $header_subject: contains "monkey"
    then
    fail text "This email is SPAM."
    seen finish
    endif
     
  10. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Syntax is correct. Make sure the filter is placed correctly and exim is restarted.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page