I'm sending e-mails to an e-mail address from our network (let's call it [email protected]) using sendmail. The output message in that machine shows the recipient as "ok" and shows that the message is being sent to that e-mail address, but when we see our smtp hub server, the request arrives as to send the message to [email protected] (missing the "br."), so the message never arrives.

It seems like sendmail is replacing from whatever domain I indicate for the recipient to the machine's subdomain name ($m which is, indeed, "domain.com").

Is there anyway I can prevent sendmail from replacing the recipient e-mail domain?

I've got sendmail version: 8.14.7. The O.S. is a Linux Red Hat distribution, version 7.9.

  • When you write "SendMail" do you mean a command or tool that's capitalised like that or do you mean the sendmail command? If it's the second then which Mail Transport Agent (MTA) are you using to implement sendmail? Jan 2, 2023 at 12:51
  • I mean sendmail command (I guess). The Linux sendmail service (/etc/mail/) Jan 2, 2023 at 13:09
  • This is not a standard behavior; I'm guessing your local admin has broken the rules.
    – tripleee
    Jan 2, 2023 at 13:13
  • No point guessing, as the configuration files vary depending on the answer. Does sendmail -v or sendmail --version or sendmail -V shed any light on the matter? Please edit your question to provide the information (and fix "SendMail" to match reality, while you're there). Jan 2, 2023 at 13:14
  • It would be helpful for you to tell us the Linux distribution or UNIX version too, as that often has relevance in this kind of situation Jan 2, 2023 at 13:16

1 Answer 1


I came here having the same problem.

Mails addressed to user@domain1 were changed to user@domain2.

In my case the domain1 and domain2 were hosted on the same machine/mail server. That machine's regular hostname is domain2 while domain1 is "only" a DNS alias to domain2. Apparantly sendmail does a reverse lookup on the to-address and changes that address to whatever comes up as basis DNS entry.

My solution: It may not be the best approach, but I added an entry to the sending machine's /etc/hosts file that says: domain2 domain1

While that entry is active mails to user@domain1 are being correctly transmitted.

So in your case do your domains happen to resolve to the same IP address?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .