2

I have a Ubuntu server that has a few WordPress sites on it. The hostname for the server is set to something like: ip-xxx-xxx-xxx.internal. So when WordPress sends an email (via PHP, via sendmail) it uses that hostname in the EHLO command. This causes some mail servers to reject the email.

I can't change the hostname for the server, and each site needs a different hostname anyway, so need a way to set this per website. So I think that also rules out any php.ini changes or sendmail/postfix config changes.

I looked at WordPress plug-ins, but I think they all expect you to just use a different SMTP server (relaying), and that isn't what I want. I just want to use the current setup, but have it report the correct hostname for each site.

Hopefully this is something easy I just overlooked... site needs to go live tomorrow. Thank you!

eselk
  • 6,764
  • 7
  • 60
  • 93
  • Do you use separate IP address per www site? – AnFi Jan 29 '14 at 20:52
  • No, there is at least one other site on the same server (instance) with the same IP. – eselk Jan 29 '14 at 23:58
  • This ended up being related to my issue, so linking here for future readers: http://stackoverflow.com/questions/5666312/php-mail-issue-with-www-data – eselk Feb 01 '14 at 01:31

2 Answers2

1

I fear you can't manipulate the EHLO expect the sendmail-config on linux.
I remember that there was kind of an option in Windows.... anyway. But you do not want to edit the config and it's just per host anyway.

If I'm right, according to RFC, you need a fully qualified domain name (one that actually resolves). If that's not the case ISPs will deny the mail.
Please correct me if I'm wrong.

avarx
  • 509
  • 5
  • 21
  • Thanks for taking the time to provide this answer. I accepted the other because I felt it was more detailed -- me being a sendmail newb, I really needed the details. – eselk Jan 30 '14 at 01:53
0

You may change "this host email name" used by sendmail. It is also used by default in outgoing EHLO/HELO.

Sendmail: Who Am I?

Add the following line to sendmail.mc, recompile it into sendmail.cf and restart/HUP sendmail daemon.

define(`confDOMAIN_NAME', `host.example.net')dnl
AnFi
  • 10,493
  • 3
  • 23
  • 47
  • I've never worked with these files before, but I have someone who can help me with the details. Is there one of these per website folder, so I can just change the file for one site and not the entire server? – eselk Jan 29 '14 at 23:53
  • It is for entire server. It is less than you have asked for but it should reduce number of EHLO/HELO based rejects you face. – AnFi Jan 30 '14 at 00:00