Reject senders based on wildcard domain names like *.link
Hi
We want to reject all mails from domains like *.link and *.*.link at the earliest stage, server level (not domain level). I have searched around but no working solution could be located. We don't want to mark these as spam. We just want to delete these straightaway.
Can you please help?
Some additional information to help you:
Centos server, running cpanel ver 11.46.0 (build 17). Has mailscanner installed by Configserver team.
-
Hello :) The following thread should help: How to filter all email from specific TLD Thank you. 0 -
Nice one. Thanks Michael. I have applied the custom filter option and it seems to work. Do you suggest having one if with several ORs or several blocks, each with one rule? 0 -
You should be fine with multiple "OR" statements, but feel free to test the custom filter rule and let us know how it works. Thank you. 0 -
Ref: Exim custom filter The code below does not stop the mail from someone@gmail.com. Any clue? I restarted Exim after saving the custom filter and it is also set as the custom filter in the WHM Exim configuration. if first_delivery and ("$h_from:" contains "somename@gmail.com") then seen finish endif Edit: Typo corrected 0 -
]Hello :) The following thread should help: How to filter all email from specific TLD Thank you.
can it be achieved with the method described here ?0 -
3 posts above yours here, is a link posted by cPanelMichael. Have a peek at that one. 0 -
]3 posts above yours here, is a link posted by cPanelMichael. Have a peek at that one.
I saw that post and method. But I asked how to do it (if possible) with the method described here: # Inserted to block domains access # Local from blacklist: /etc/exim_blacklist reject_domains: driver = redirect # RBL Blacklist incoming hosts domains = +exim_blacklist allow_fail data = :fail: Connection rejected: SPAM source $domain is blacklisted.0 -
The method in the referenced thread uses an Exim filter rule, whereas the method you posted is a modification of the Exim configuration. You are welcome to use whichever method you prefer, but you may want to test both methods to ensure they are working as intended. Thank you. 0 -
I did the following and it is not working (FWIW, I use Exim and Mailscanner both): I changed the Exim filter to cpanel_exim_filter_custom In this file, I have the following: if "$header_from:" ends ".link" or "$header_from:" ends ".rocks" then seen finish endif I had tried with $h_from also. We have also tried if "$header_from:" ends ".link" or "$header_from:" ends ".rocks" then pipe "/dev/null" endif Nothing is stopping the mail. I am assuming that Exim gets to handle the mail first and then Mailscanner takes over. Is it possible that Mailscanner is bypassing the Exim filter and therefore the filter is not having any effect? TIA 0 -
Thanks Stormy. However please note that I have set up filters to delete these mails but the filter does not seem to work. That is my primary concern here. 0
Please sign in to leave a comment.
Comments
11 comments