Blocking inbound spam from fake domains on my server(s)

koda

Well-Known Member
Jan 10, 2014
63
2
58
cPanel Access Level
Root Administrator
What I'm trying to obtain is this. We often receive spam emails FROM address/domains (even with fake address but correct domain) that are hosted on our server.
In the headers the Return-path is correct, the Envelope-to is correct and so on. The only thinkg that doesn't match of course is the IP of the server which sent the email since it didn't originate from our server. I mean none of our emails has been scammed, is just someone using a different server to send US spam with our emails.
Is there a way to block this? I mean something to mark as spam (or delete straight away) all INCOMING email from domains on the mail server but sent from a different IP? Or more generic all incoming email from a list of domains but whose IP is not included in a list of IPs? (this last option would give more flexibility when for example you have multiple servers with different domains but wich send mails each other like for example in a single organization with multiple domains and multiple servers for each domain)
Thanks in advance for your suggestions.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

You could enable the following option in "WHM Home » Service Configuration » Exim Configuration Manager" under the "ACL Options" tab to help prevent these types of emails:

"Reject SPF failures"

This will reject mail at SMTP time if the sender fails SPF checks.

Thank you.
 

koda

Well-Known Member
Jan 10, 2014
63
2
58
cPanel Access Level
Root Administrator
Hallo Michael thanks. But won't this prevent domains who don't have spf record to be rejected as well? Or just SPF mismatch where an SPF record IS present?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hallo Michael thanks. But won't this prevent domains who don't have spf record to be rejected as well? Or just SPF mismatch where an SPF record IS present?
Yes, this will reject emails from domain names without valid SPF records, not just mismatches. You can leave it disabled, but it's the best way to prevent the type of email messages you have described. Another option would be to manually block the IP addresses that sent you the spoofed messages.

Thank you.