Skip to main content

EXIM - Filters - Need help with blocking all forwarding to external domains

Comments

3 comments

  • phil99
    Far from being an expert in this, but I think: - "for" is not a header. The header is "Received:" of which "for" is a part. So you would need to use "$header_received:" or the less specific "$message_headers". - "discard" is not a valid filter command [1], [2]. I've no experience with lookups, but some thoughts: Are they valid in filter files? Is "is [not] in" valid syntax? Altough it is less easily maintainable, it might be easier with a list of domains in the filter file using "or". Hopefully someone with more experience will chime in. [1] 3. Exim filter files [2] 47. System-wide message filtering
    0
  • cPRex Jurassic Moderator
    Thanks, @phil99 !
    0
  • Archie Pashovkin
    Thanks, @phil99! Links helped a lot With an information from emailaddress@domain.com" then save /dev/null finish endif Version 2: if $message_headers: contains "emailaddress@domain.com" then seen finish endif Also Filter can be done with Reject Message to sender : if $message_headers: contains "emailaddress@domain.com" then fail text "Emails to this address are not allowed" #Enter any message you want sender to receive as a reject message endif Keep working on the second filter to discard any emails to external domains Will keep you guys posted on success
    0

Please sign in to leave a comment.