From 1929ea64c6a38a476e48806e38591f893d8cbde8 Mon Sep 17 00:00:00 2001 From: Rob Peters Date: Mon, 28 Sep 2026 18:11:47 +0200 Subject: [PATCH] Allow configuring SMTP HELO name via PHPMAILER_HELO PHPlistMailer always used getConfig('domain') as the SMTP HELO/EHLO name. When sending through a remote SMTP server (PHPMAILERHOST), many Exim/DirectAdmin servers reject a remote client that greets with the server's own local domain, so sending fails even with valid SMTP authentication. Changing the "domain" setting is not a workaround, as it is also used for the [DOMAIN] placeholders in the default addresses. Add an optional PHPMAILER_HELO constant. When it is not defined or empty, the previous behaviour (the "domain" setting) is kept. --- public_html/lists/admin/class.phplistmailer.php | 2 +- public_html/lists/config/config_extended.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public_html/lists/admin/class.phplistmailer.php b/public_html/lists/admin/class.phplistmailer.php index 2887f121a..24e1b2008 100644 --- a/public_html/lists/admin/class.phplistmailer.php +++ b/public_html/lists/admin/class.phplistmailer.php @@ -76,7 +76,7 @@ public function __construct($messageid, $email, $inBlast = true, $exceptions = f if (isset($_GET['page']) && $_GET['page'] == 'send') { $this->inBlast = false; } - $this->Helo = getConfig('domain'); + $this->Helo = defined('PHPMAILER_HELO') && PHPMAILER_HELO ? PHPMAILER_HELO : getConfig('domain'); if ($GLOBALS['emailsenderplugin']) { $this->Mailer = 'plugin'; diff --git a/public_html/lists/config/config_extended.php b/public_html/lists/config/config_extended.php index f453ac888..8734953ea 100644 --- a/public_html/lists/config/config_extended.php +++ b/public_html/lists/config/config_extended.php @@ -640,6 +640,10 @@ // it can either be "ssl" or "tls" or false to not use SSL/TLS at all // define("PHPMAILER_SECURE",'ssl'); +// Hostname to use in the SMTP HELO/EHLO greeting. Defaults to the "domain" setting. +// Set this when your SMTP server rejects the list domain as HELO (e.g. use the web server's FQDN) +// define('PHPMAILER_HELO', 'www.mydomain.com'); + //# SMTP debugging // Enable debugging output by phpmailer when sending test emails // See https://phpmailer.github.io/PHPMailer/classes/PHPMailer-PHPMailer-PHPMailer.html#property_SMTPDebug