Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to block e-mail that contains a field of annexes by domain

Discussion in 'E-mail Discussion' started by suporteidc, Sep 23, 2008.

  1. suporteidc

    suporteidc Registered

    Joined:
    Sep 23, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    Hello,

    I would like to know if there is any possibility of blocking mail that contains annexes on the server by domain, for example:

    domain1.com.br = blocking annexes ". mp3, .exe, .mpg, .mpeg, .jpg, .gif".


    It is possible? How to make this process?

    Thanks,
     
  2. d_t

    d_t Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    Bucharest
    you mean attachments? try something like this in exim filter file (usually, /etc/cpanel_exim_system_filter )

    Code:
    if $header_from: contains "@domain1.com.br" and $header_content-type: matches "(?:file)?name=(\"[^\"]+\\\\.(?:mp3|exe|mpg|mpeg|jpg|gif)\")"
    then
      fail text "This message has been rejected because it contains a blocked attachment."
      seen finish
    endif
    
     
  3. suporteidc

    suporteidc Registered

    Joined:
    Sep 23, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    Hello d_t.

    Thanks for your help.

    But not satisfied this command, not blocked anything.

    Have some more Suggest?
     
  4. lngtanseco

    lngtanseco Well-Known Member

    Joined:
    Jun 9, 2006
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    156
    Check if you are modifying the correct file.

    Normally it's something like below:

    WHM > Exim Configuration Editor > ** System Filter File [?] > /etc/cpanel_exim_system_filter


    Then try this code.

    Code:
    if      (
             $header_from contains "domain1.com.br"
            ) and (
             $header_content-type: matches "(?:file)?name=(\"[^\"]+\\\\.(?:mp3|exe|mpg|mpeg|jpg|gif)\")"
    )  then
       fail text "This message has been rejected because it contains a blocked attachment."
      seen finish
      endif

    If that doesn't work, you may want to post the content of /etc/cpanel_exim_system_filter for review.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    168
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Another way of doing this, if you can't get cPanel filters to work, is MailScanner. You can get MailScanner via www.configserver.com and there is a FAQ entry there describing similar stuff to what you are trying. It does require server root access to install though, and a little time; although they (configserver) will do it for you and are very trustworthy and good at what they do.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice