Skip to main content

Exim Custom Filters don't work

Comments

6 comments

  • rpvw
    For the headers rewrite part of your rule, try this then headers add "Old-Subject: $h_subject:" headers remove "Subject" headers add "Subject: SpamRule: EXIM FILTER Block Unwanted Domains (was: $h_old-subject:)" headers remove "Old-Subject" deliver "spam@mydomain.com" endif
    If you just want to send the email to a black-hole use then seen finish endif
    Don't attempt to use both a header rewrite and a black-hole delivery on the same rule.
    0
  • diracuser
    Thank you rpvw. I rewrite the rule. I will check if now works... I have one question: are the rules case-sensitive ? For exemple I write $h_return-path in lowercase . Is this correct ? I can see that you write : Old-Subject as header in upper-lowercase and the variable in lowercase .... Thank you
    0
  • diracuser
    Hello again. I try to send spam emails to my server, and I check that if I send as "hello@mydomain.bid" the system-filter catch this email and send to spam@mydomain.com without subject modification. If I send as "hello@example.com" the filter doesn't check the email and I recieve in my inbox .... I check and the return-path is: hello@example.com Any ideas? Thank you
    0
  • rpvw
    This is what I do to include custom exim filters: 1) Add a new filter file to /usr/local/cpanel/etc/exim/sysfilter/options/ eg inbound_tld_block (IMPORTANT: new file should have blank line at top and bottom) 2) Go to WHM > Service Configuration > Exim Configuration Manager (Basic Editor) and click Save at the bottom of the page - you should get something like..... Your changes have been saved. Restarting cPanel daemons...done. Updating your system to reflect any changes... Creating new setting for "filter_inbound_tld_block" of "On". "filter_inbound_tld_block" was updated. Done. Your configuration changes have been saved! Waiting for "exim" to restart "waiting for "exim" to initialize "finished.
    and you will see in the newly generated /etc/cpanel_exim_system_filter file the following # BEGIN - Included from /usr/local/cpanel/etc/exim/sysfilter/options/inbound_tld_block # (Use the Basic Editor in the Exim Configuration Manager in WHM to change) # or manually edit /etc/exim.conf.localopts and run /scripts/buildeximconf ....your filter code here.... # END - Included from /usr/local/cpanel/etc/exim/sysfilter/options/inbound_tld_block
    0
  • cPanelLauren
    Thank you @rpvw for the detailed reply this is great advice.
    0
  • diracuser
    Thank you @rpvw . After modify the file I didn't press the button "Save" in EximConfiguration --> Basic Editor --> Filter. I Know that every modification in that custom file I have to save.
    0

Please sign in to leave a comment.