Prevent remote email from my own domain

gramzon

Active Member
Dec 4, 2017
32
5
58
Croatia
cPanel Access Level
Root Administrator
How can I block incoming email from remote servers with "mail from: *@mydomain.com" header where mydomain is a domain hosted on my server?
I tested this by executing
Code:
telnet mydomain.com 25
from a different server and set
Code:
The e-mail is accepted.
If I set the "rcpt to:" header to a remote domain, then the server properly responds with 550 not permitted to relay, because all users are required to authenticate to relay through my server, but I want all users to be forced to authenticate if the "mail from:" is a local address as well, regardless of recipient.
 
Last edited:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
SPF and DKIM are in place to limit the ability of mail being sent this way. If the host isn't authorized to send for your domain it should fail SPF, same issue if the DKIM signature isn't found. You can also choose to deny DKIM failures in Exim.

What it sounds like you're referencing is a relay: Stop Mail Relay - this thread goes over open relays.