Skip to main content

Exclude Email Account from System Filter Rule

Comments

5 comments

  • cPanelMichael
    Hello, You could try adding a separate filter rule ahead of the existing one that allows the message to proceed if it matches the specific condition you want to whitelist. Use the "Stop Processing Rules" action on the new filter rule so that the additional filter rules are not processed. Here's a document you may find helpful:
    0
  • vponteras
    How do I position the filter rule? Is it before the fail rule or after it? Will this do? # Block all except for listed domains 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 # Exclude email account from block all rule if ($h_from: contains "excluded@our-domain.com") and ($h_to: contains "@") then finish endif
    0
  • cPanelMichael
    Hello, You'd actually want to add the new rule before the existing rule. Here's an example of how it should look: #123 if $header_from: matches "excluded@our-domain.com" then finish endif
    Thank you.
    0
  • vponteras
    Hi Michael, will this do? if ($h_from: matches "excluded@our-domain.com") then finish elif ( $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 endif
    0
  • cPanelMichael
    Hello, That looks like a single rule. You should try setting up multiple rules first, like you started in your previous example. Thank you.
    0

Please sign in to leave a comment.