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.

System filters through antivirus.exim

Discussion in 'General Discussion' started by noimad1, Aug 11, 2004.

  1. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    I currently use the antivirus.exim file to filter out bad words, or bad sets of words. I have it discard the e-mail right away.

    Here is an example of one filter:

    PHP:
    if $message_bodycontains Cialis
    then
    seen finish
    endif

    I know i can put a "fail text" in there and it will bounce the e-mail back to the person who sent it. However, I don't want to do this becuase my mail que starts filling up with bogus e-mails.

    What I would like to do is have it mark in the exim_mainlog what filter caugt it....for example, there are lines in my exim_mainlog that look like this:

    2004-08-09 13:34:28 1BuEyX-0004Iz-Iu => discarded (system filter)

    is there any code I can put in the antivirus.exim if statement that would put why it was discarded in that line in the exim_mainlog.

    The reason I ask is occassionaly my customers e-mails get filtered...and it would be very helpfull to find out which filter was catching it...

    Thanks
    Damion
     
  2. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Ok, I think I figured it out by myself. For anyone that is interested, here is what you can do:

    1. Make a new file called /etc/filter.log
    2. Put this line that the top of your antivirus.exim:
    Logfile /etc/filter.log
    3. Whenever you filter stuff write it to the log like this:
    PHP:
    if $message_bodycontains affordablemeds
    then
    logwrite 
    "affordablemeds from: $sender_address $tod_log $message_id processed"
    seen finish
    endif
    Then it will log the word caught, the sender, date/time, and message id.....
     
Loading...

Share This Page