Why does sendmail replace non-existent domains with the local domain name?

3

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 info@thisdomaindoesntexist.com
this is my message
^D

After doing this, I find an email to info@www.mydomain.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 info@thisdomaindoesntexist.com, but then the server changed it to info@www.mydomain.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.

Matt

Posted 2010-11-12T18:59:35.757

Reputation: 51

It is sendmail that's doing it. I think it is assuming that thisdomaindoesnotexist.com is a host on the local domain. As to the fix, I am digging. – RobotHumans – 2010-11-12T19:05:50.843

Answers

2

Thanks for the help aking1012, and thank you parallels forums: http://www.forum.psoft.net/showthread.php?t=13231

This was actually a DNS issue. Our nameserver had a wildcard ('*') entry that resolved to our domain. When I ping'd a non-existent domain on any of our servers, it was resolving to our domain again. I took out the wildcard entry in the DNS Zone record, and bingo! In the thread referenced above there are ideas on what can be done without having to remove the wildcard entry. In our case, it just made sense to take it out.

Matt

Posted 2010-11-12T18:59:35.757

Reputation: 51