RTC bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar TLWebdesign
TLWebdesign
10 Nov 2025

Pull Request for Issue #46419.

Summary of Changes

Remove the false flag for "auto" on the setFrom method from PHPMailer in the MailTemplateFactory. This will improve the standard Joomla e-mail deliverability because now the Return-Path, envelope-from and From are aligned.
By default Joomla was setting this "auto" flag to false. Although PHPMailer's default is "true".

The behaviour won't change for reply-to. E-mail clients already use From as the fallback if there is no reply-to set.
Bounces now are sent to the wrong place for instance user@server.com instead of the "from mail" set in the configuration, this fix solves that issue.
With this fix SPF and DMARC domains will now be aligned and with that improve e-mail deliverability.

Testing Instructions

Set your "Mailer" to PHP Mail in Global Configuration -> Server -> Mail -> Mailer
Send an e-mail using the test e-mail from the configuration or do a lost password check.
Check e-mail headers and see that headers don't align.

Actual result BEFORE applying this Pull Request

Return-Path and envelope-from DON'T match the From.

Return-Path: <user1@srv1.example.nl>
    (envelope-from <user1@srv1.example.nl>)
From: Example Name <noreply@domain.nl>

Expected result AFTER applying this Pull Request

Return-Path and envelope-from DO match the From.

Return-Path: <noreply@domain.nl>
(envelope-from <noreply@domain.nl>)
From: Example Name <noreply@domain.nl>

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar TLWebdesign TLWebdesign - open - 10 Nov 2025
avatar TLWebdesign TLWebdesign - change - 10 Nov 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Nov 2025
Category Libraries
avatar TLWebdesign TLWebdesign - change - 10 Nov 2025
Title
Fix for envelope-from & return path alignment with From in MailTemplateFactory
[5.4] Fix for envelope-from & return path alignment with From in MailTemplateFactory
avatar TLWebdesign TLWebdesign - edited - 10 Nov 2025
avatar TLWebdesign TLWebdesign - change - 10 Nov 2025
The description was changed
avatar TLWebdesign TLWebdesign - edited - 10 Nov 2025
avatar brianteeman
brianteeman - comment - 11 Nov 2025

I dont see any difference with the headers after applying this PR

image
avatar TLWebdesign
TLWebdesign - comment - 11 Nov 2025

Hi @brianteeman did you use SMTP? according to your headers it looks like you did. This test is about PHPMailer not SMTP. I'll update my instruction to make that more clear. Thanks for testing!

avatar TLWebdesign TLWebdesign - change - 11 Nov 2025
The description was changed
avatar TLWebdesign TLWebdesign - edited - 11 Nov 2025
avatar exlemor exlemor - test_item - 11 Nov 2025 - Tested successfully
avatar exlemor
exlemor - comment - 11 Nov 2025

I have tested this item ✅ successfully on 5e090e7

I have successfully tested this. The BEFORE and AFTER match PR description - thanks @TLWebdesign.

(In my case, it didn't alter my SPF, DKIM, etc results they were before and after PASS but cool for those configs where it would cause issues)

Thanks for the contribution :)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46431.
avatar muhme muhme - test_item - 22 Nov 2025 - Tested successfully
avatar muhme
muhme - comment - 22 Nov 2025

I have tested this item ✅ successfully on 5e090e7

Tested with JBT and Patch Tester, but not seen in MailDev (it may be related to the Return-Path is only added after SMTP delivery into the mailbox). But seen before the PR in Joomla log file:

2025-11-22T18:22:30+00:00       ERROR   57.128.19.244   mail    Error in Mail API: Envelope sender:

And after applying this PR:

2025-11-22T18:22:44+00:00       ERROR   57.128.19.244   mail    Error in Mail API: Envelope sender: jbt-54@test.com

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46431.
avatar muhme muhme - change - 22 Nov 2025
Status Pending Ready to Commit
avatar muhme
muhme - comment - 22 Nov 2025

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46431.

avatar TLWebdesign TLWebdesign - change - 26 Nov 2025
Labels Added: RTC bug PR-5.4-dev
avatar richard67 richard67 - change - 26 Nov 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-11-26 16:34:24
Closed_By richard67
avatar richard67 richard67 - close - 26 Nov 2025
avatar richard67 richard67 - merge - 26 Nov 2025
avatar richard67
richard67 - comment - 26 Nov 2025

Thanks @TLWebdesign for this PR, and thanks @exlemor and @muhme for testing.

avatar laoneo
laoneo - comment - 8 Jan 2026

For all people, where setting the sender ($mailer->setSender()) is not working anymore since this got merged and land here. You can add the following code in your extension till the issue gets fixed:

if ($mailer instanceof Mail) {
	$mailer->Sender = $mailer->From;
}
avatar TLWebdesign
TLWebdesign - comment - 8 Jan 2026

Hi @laoneo, what code is not working for you anymore?

avatar laoneo
laoneo - comment - 8 Jan 2026

As I wrote, $mailer->setSender()

avatar TLWebdesign
TLWebdesign - comment - 8 Jan 2026

As I wrote, $mailer->setSender()

Ok but in what contex? Because i only touched mailerFactory not Mail itself. Have you opened a bug report with instructions so i can test it?

avatar laoneo
laoneo - comment - 8 Jan 2026

No, but create a mailer from the factory, call setSender and you will see that it has no effect.

avatar laoneo
laoneo - comment - 8 Jan 2026

Here is the issue #46643

avatar angieradtke
angieradtke - comment - 13 Jan 2026

Hello everyone, this topic is not mine, I can only report from practical experience. My customer (Ionos) is no longer receiving emails with the changes. (Sender==Recipient -> com_contact)

This is very bad and has caused a lot of trouble

avatar brianteeman
brianteeman - comment - 13 Jan 2026

so the obvious question @angieradtke is did you test this pull request to see if it solves the problem for you

avatar angieradtke
angieradtke - comment - 13 Jan 2026

so the obvious question @angieradtke is did you test this pull request to see if it solves the problem for you
I test this in online project - I removed the added code and it works again. Emailing via com_contact is a fundamental part of the project.

avatar TLWebdesign
TLWebdesign - comment - 13 Jan 2026

Yes this is the case indeed. And release managers will discuss tonight in mainteners meeting how to deal with this. So the problem is when you have a contact with the same e-mail address as the "from" e-mail address configured in the global configuration. AND your are using an external e-mail like your own exchange (in angies case) AND use phpmailer AND your e-mail server doesn't allow you to do it this way this "fix" causes your e-mail to be rejected. Easiest fix for now is just changing the e-mail address in global configuration to not be the same as your contact address. It's an anti spoof measure that is triggered this way. Becuase phpmailer is sending as external server an e-mail from-> to with same address.

avatar richard67
richard67 - comment - 13 Jan 2026

And release managers will discuss tonight in mainteners meeting how to deal with this.

@TLWebdesign Tomorrow.

avatar TLWebdesign
TLWebdesign - comment - 13 Jan 2026

You're right. Tomorrow wednesday. I have my days mixed up.

Add a Comment

Login with GitHub to post a comment