Steps to replicate the issue:
- Configure the email like suggested in https://www.mediawiki.org/wiki/Manual:$wgSMTP:
$wgSMTP = [ 'host' => 'tls://smtp-relay.gmail.com', 'IDHost' => 'wiki.domain.org', 'port' => 465 ];
- Test email sending from https://wiki.domain.org/wiki/Special:EmailUser.
I am using gmail smtp relay with TLS and IP authentication so those 3 parameters should be sufficient.
What happens?:
Failed to connect to tls://smtp-relay.gmail.com:465 [SMTP: HELO was not accepted (code: -1, response: )]
What should have happened instead?:
Email should be sent correctly.
Software version:
1.35.7 (5c3da73) 11:14, 23 August 2022
Workaround:
Add 'localhost' => 'wiki.domain.org', see bellow:
$wgSMTP = [ 'host' => 'tls://smtp-relay.gmail.com', 'IDHost' => 'wiki.domain.org', 'localhost' => 'wiki.domain.org', 'port' => 465 ];
You can add debuging information to see that mediawiki presents the parameter HELO containing localhost instead of the content of IDHost:
$wgSMTP = [ 'host' => 'tls://smtp-relay.gmail.com', 'IDHost' => 'wiki.domain.org', 'port' => 465, 'debug' => true ];
Side note: the https://www.mediawiki.org/wiki/Manual:$wgSMTP documentation contains a 404 link: