When I send an email to a non-existent domain, or a domain without an mx record, I am receiving the email at my domain for the same user. To clarify my issue, here's an example:
from the command line I send an email
/usr/sbin/sendmail firstname.lastname@example.org this is my message ^D
After doing this, I find an email to email@example.com (where www.mydomain.com is the domain name of the server from which I sent the email). In the headers of the email, I see that originally the To: address was firstname.lastname@example.org, but then the server changed it to email@example.com.
Ideally, I want the mail server to discard this message or bounce it, not relay it to my domain.
I've been playing around with the sendmail config (/etc/mail/sendmail.mc) for hours, but I am still having no luck with figuring out why this is happening. Is this even sendmail that's doing it, or am I looking in the wrong place?
Thanks in advance.