View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0017933||phpList 3 application||public||17-11-15 20:23||21-06-18 13:05|
|Target Version||Fixed in Version||3.2.4|
|Summary||0017933: Incorrect Hostname Provided to SMTP Server|
|Description||Hostname reported via SMTP is the website address instead of the domain name. Settings configured in Config -> Settings in the web GUI. While I imagine these are often the same, I wasn't able to send email because I'm running phpList on a different port and that caused the SMTP server to give an 'invalid host name' error. I saw on tcpdump that the "Website address (without http://)" setting was being provided instead of the "Domain Name of your server (for email)".|
|Steps To Reproduce||ran command:|
tcpdump -i <interface> port 25 -X
phpMailer will use the "Hostname" for the SMTP greeting.
This is set in phpList here: https://github.com/phpList/phplist3/blob/master/public_html/lists/admin/class.phplistmailer.php#L128
which is first taken from the SERVER_NAME and then it will fall back to the "domain" config setting.
Check that your servername is correct.
I don't think that this is working as you intend.
phpmailer uses $this->Helo
which is set by phplistmailer to the website address
This is confirmed by using smtp debug
CLIENT -> SERVER: EHLO www.dcameron.me.uk
which is my value for "website address", not the "domain name of your server".
But is www.dcameron.me.uk your SERVER_NAME ? Then it is as expected.
I guess we can change it to use the config domain and fall back to SERVER_NAME instead.
I was trying to explain how the code currently seems to work.
phpmailer uses $this->Helo and if that is not set falls back to use $this->Hostname.
But the code in phplistmailer always seems to set $this->Helo to the website address. It does also set $this->Hostname to SERVER_NAME but because of setting this->Helo that is not used.
Ah, yes, true. phplistmailer sets the Helo,
so https://github.com/phpList/phplist3/blob/master/public_html/lists/admin/class.phplistmailer.php#L128 is not used.
It makes more sense to set the Helo to the "domain" setting. Will change that.