Skip to main content

Exim Deny All Except

Comments

9 comments

  • cPanelMichael
    Hello, Could you also outline the specific steps you have taken thus far to implement that custom filter rule? Note the email filter options in cPanel are designed to filter incoming email. You can customize the Exim system filter if you want to apply a filter to outgoing email. Information about modifying the Exim system filter is documented at:
    0
  • vponteras
    Hi cPanelMichael, I am using the system filter /etc/cpanel_exim_system_filter_custom. I want block all incoming and outgoing mails except for our domain, allowed1.com and allowed2.com. Because we're planning to have our mails for company mails only and prevent incoming mails except for allowed1.com and allowed2.com What should be the suitable filter for that setup?
    0
  • cPanelMichael
    Hello, The rules in your initial post look okay. In "WHM >> Exim Configuration Manager", under the "Filters" tab, are you using a custom filter for the "System Filter File" option? If so, you'd need to add your custom filter rules to that custom system filter file itself instead of adding them as separate filter files under the options directory. There's a thread on this topic at:
    0
  • vponteras
    I am already using our custom filter
    0
  • vponteras
    Hi, anybody can help?
    0
  • rpvw
    In a normal account filter rule, the 'or' operator does not work using . I don't know about the custom rules for exim outgoing mail, but you could have a look at to see if it might be of any help.
    0
  • vponteras
    Hi, This seems to work for me if ( $h_to: does not contain "our-domain.com" and $h_to: does not contain "allowed-domain1.com" and $h_to: does not contain "allowed-domain2.com" and $h_to: does not contain "allowed-domain3.com" and $h_to: does not contain "allowed-domain4.com" ) and ($h_from: contains "our-domain.com") then fail text "Unauthorized Mail" endif
    0
  • cPanelMichael
    Hello, I'm glad to see you found a suitable filter rule. Thank you for sharing the outcome.
    0
  • ragunathanc
    Hi if ( $h_to: does not contain "our-domain.com" and $h_to: does not contain "allowed-domain1.com" and $h_to: does not contain "allowed-domain2.com" and $h_to: does not contain "allowed-domain3.com" and $h_to: does not contain "allowed-domain4.com" ) and ($h_from: contains "our-domain.com") then fail text "Unauthorized Mail" endif This code works for single email id in to address. if you combined with "our-domain.com", "allowed-domain1.com", "gmail.com","yahoo.com" means mails goes to all the email id's. please share the solution. Thank you.
    0

Please sign in to leave a comment.