Search code examples
centossendmailcentos7postfix-mta

Centos 7 + sendmail is sending from wrong hostname


I'm stumped: when an email arrives from my server, its from the wrong hostname.

Centos 7

$ postconf -n
....
myhostname = myserver.example.com
....
$ hostname --fqdn
myserver.example.com

$ cat /etc/hosts
123.123.123.123 myserver myserver.example.com
127.0.0.1 localhost

But when receiving an email sent from this host, the From address is different.domain.com

I do see that there is no /etc/mail directory nor /etc/mail/sendmail.cf or /etc/mail/sendmail.mc files.

Ideas, suggestions?

Dan


Solution

  • First you need to check your logs! Is it REALLY Postfix sending the mail or is it a leftover sendmail install?

    When Postfix is running: The address used in the sender (envelope and header) is governed by the myorigin parameter. It defaults to:

    myorigin = $myhostname

    So, it should be "myserver.example.com"