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: p415N29k014483: to=<email@example.com>, delay=00:00:19, xdelay=00:00:01, mailer=esmtp, pri=453786, relay=emdch-mx31.nt.gov.au. [184.108.40.206], dsn=5.7.1, stat=Service unavailable May 1 16:09:44 serverA sendmail: p4169GH4016129: to=<firstname.lastname@example.org>, delay=00:00:26, xdelay=00:00:01, mailer=esmtp, pri=461650, relay=emdch-mx21.nt.gov.au. [220.127.116.11], 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 127.0.0.1 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.