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.

E-mail Filtering

Discussion in 'E-mail Discussions' started by mikeyb, Apr 27, 2004.

  1. mikeyb

    mikeyb Registered

    Joined:
    Apr 27, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Just trying to work out an idea in my head for the E-mail Filtering in Cpanel.

    As there is not an option to filter email for something that DOES NOT contain "text" I was wondering if it's possible to use the "matches regex" option?

    What I want to try and do is filter all email where the To address DOES NOT contain "-email"
    I.E: I want to let thru "mary-email@domain.com" or "bob-email@domain.com" but discard anything like mary@domain.com or harry@domain.com

    Do you get what I mean?

    Cheers
    Mike
     
  2. ahwheelock

    ahwheelock Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    I'll give another example of a way this would be useful, and I'm looking for. Would there be a way to reject mail where none of the headers include "spamh.com" (the relay servers for spamstopshere.com, which we use for filtering.

    The idea being to stop spammers from guessing around the MX records set in the DNS and bypassing that service. Only mail getting handled properly by MX would be permitted.

    Anybody know how I could do this with a regex, since that seems to be the only filter that could be used to filter mail that does not contain something.

    Thanks.
     
  3. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Mike,

    Do you want to filter out for just one domain or your whole server. If your whole server you can use your antivirus.exim file....add something like:

    if $message_headers: does not contain "whatever"
    then
    endif
     
  4. ahwheelock

    ahwheelock Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    Yeah, whole server would be easy. Unfortunately, I'm trying find a way to do it for the individual domains that use spamstopshere for example. PREFERABLY, using tools they can implement easily in cpanel, i.e....using the filter feature.
     
  5. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    I don't know exactly how it works, but could you setup a perl script that filters the mail, then just pipe the mail to that script? For some reason I remember seeing some else do that?
     
Loading...

Share This Page