Ben Harold asked:
I have a web server that was blacklisted from sending email because it was responding to
SMTP HELO with
localhost.localdomain instead of the domain name of my server (we’ll call it
example.com). I was able to get the server to respond to the
example.com by removing
localhost.localdomain from my
/etc/hosts file. However, now any time I try to send email to an address with the same domain name, sendmail is attempting to deliver the message locally instead of sending it via SMTP to our actual mail server (which is hosted at Rackspace).
I followed the advice here: Why sendmail is accepting mails for hostname not present in local-host-names file? and ran
echo '$=w' | sendmail -bt
[mail] [162.243.XX.XXX] mail [mail.example.com] mail.example.com localhost [127.0.0.1] example.com
From what I understand, sendmail considers all of those domains local. I set
DontProbeInterfaces=True in my
sendmail.cf file. Now when I run
sendmail -bt $=w
localhost [127.0.0.1] example.com
I also tried removing
/etc/mail/local-host-names, but sendmail still thinks that
example.com is local. How can I get sendmail to stop attempting local mail delivery for
example.com email addresses?
echo '$j' | sendmail -bt
I tried changing the hostname from
example, but now my
SMTP HELO response is
localhost and it takes several minutes to send an email. According to this: https://www.digitalocean.com/community/questions/sendmail-is-slow-to-send-mail
hostname to be the FQDN, but I’m being told that it should never be the FQDN. Which is it?
This is in my
Jul 28 16:40:01 localhost sm-msp-queue: My unqualified host name (localhost) unknown; sleeping for retry Jul 28 16:41:01 localhost sm-msp-queue: unable to qualify my own domain name (localhost) -- using short name
Fix your server’s hostname. No server should ever have a hostname equal to the naked domain name; this is but one of the many problems which occurs when you do this.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.