I set up a Server A with sendmail running, just for sending emails for other Servers. I put:

Connect:[Server B's external IP]                RELAY  

in /etc/mail/access file and compiled to access.db.

I have Server B to use Server A to send out emails.

Sometimes I will get rejected emails:

554 5.7.1 <localhost.localdomain>: Helo command rejected:

Looks like mail Server A didn't send out emails correctly, it should put Server B's domain name in the email while sending out, shouldn't be . I believe that's the reason my mail got rejected.

Question: How do I configure Sendmail on Server A not to use localhost.localdomain?

More logs: On Server A's maillog:

May  1 15:23:23 serverA sendmail[14485]: p415N29k014483: to=<xxx@nt.gov.au>, delay=00:00:19, xdelay=00:00:01, mailer=esmtp, pri=453786, relay=emdch-mx31.nt.gov.au. [], dsn=5.7.1, stat=Service unavailable
May  1 16:09:44 serverA sendmail[16131]: p4169GH4016129: to=<xxx@nt.gov.au>, delay=00:00:26, xdelay=00:00:01, mailer=esmtp, pri=461650, relay=emdch-mx21.nt.gov.au. [], dsn=5.7.1, stat=Service unavailable


It is good practice to set each server to have full URL name: serverA.example.com. Also, leave localhost.localdomain localhost untouched. Create a new entry with your actual server IP mapping: [ip] serverA.example.com serverA This should fix the issue and sendmail will response full URL name instead of localhost.localdomain.

Thanks tim

  • Do you have additional logs or configurations you can show us? It's a little difficult to determine the context here.
    – Mike B
    May 13, 2011 at 2:51
  • Thanks Mikey B, I have added more log from /var/log/maillog on Server A. Please let me know if you need more. Thanks very much!
    – starchx
    May 15, 2011 at 7:43

1 Answer 1


"helo command rejected" means that your "A" server didn't even get as far as the first verb in the SMTP Relay conversation. The envelope sender and recipient are thus not the problem. They haven't even been sent at the point that the error occurs.

The error is response code 554, extended response code 5.7.1. This is the conventional "I don't want to talk to someone at your IP address." response code. The reasons why are up to the server owner, and can vary from

This blacklist says that you are a third-class Internet citizen and I am treating you as such.


There isn't actually an SMTP Relay server here, you know.

In this particular case, the reason appears to be

The name localhost.localdomain isn't uniquely yours, and I've decided not to talk to people who configure their MTSes with that as the supposedly unique name of their MTS. You know where the confDOMAIN_NAME setting in Sendmail is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.