Skip to content

Allow configuring the SMTP HELO/EHLO name (PHPMAILER_HELO) - #1144

Open
gizmocuz wants to merge 1 commit into
phpList:mainfrom
gizmocuz:feature/configurable-smtp-helo
Open

gizmocuz wants to merge 1 commit into
phpList:mainfrom
gizmocuz:feature/configurable-smtp-helo

Conversation

@gizmocuz

@gizmocuz gizmocuz commented Sep 28, 2026 •

Copy link
Copy Markdown

Problem

PHPlistMailer always sets the SMTP HELO/EHLO name to the list domain:

$this->Helo = getConfig('domain');

When phpList sends through a remote SMTP server (PHPMAILERHOST), the greeting is the bare list domain (e.g. mydomain.com). Many Exim/DirectAdmin mail servers reject a remote client that uses the server's own local domain as its HELO, so sending fails even with valid SMTP authentication.

Changing the domain setting is not a workaround: it is also used for the [DOMAIN] placeholders in the default addresses (webmaster@[DOMAIN], noreply@[DOMAIN], listreports@[DOMAIN] in admin/defaultconfig.php).

Fix

Add an optional PHPMAILER_HELO constant:

$this->Helo = defined('PHPMAILER_HELO') && PHPMAILER_HELO ? PHPMAILER_HELO : getConfig('domain');

If it is not defined or empty, the current behaviour is kept, so this is fully backward compatible. A commented-out, documented example is added to config_extended.php next to the other PHPMAILER_* SMTP settings:

// define('PHPMAILER_HELO', 'www.mydomain.com');

This has been running as a local patch in production on 3.6.12.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant