No Code Attached Yet J4 Issue bug
avatar toivo
toivo
4 Apr 2022

Steps to reproduce the issue

Go to Global Configuration - Server - Mail.
Enter an email address into 'Reply To' and a name into 'Reply To Name'.
Click 'Send Test Mail'.

Expected result

The received email should have the reply-to header with the name and the email address in the format
Reply-To: Firstname Surname mailbox@example.com.

Actual result

The Reply-To header is missing from the received email, as shown in the first screenshot.

System information (as much as possible)

Joomla 4.1.3-dev on Wampserver 3.2.7 using PHP 7.4.26.
Using smtp.gmail.com as SMTP server.

Additional comments

In Joomla 3.10.8 in the same system the received message includes the Reply-To header, as shown in the second screenshot.
This issue was reported at the Joomla support forum (https://forum.joomla.org/viewtopic.php?f=811&t=992972 "Joomla 4 'Reply To' / 'Reply To Name' Issue")

Votes

# of Users Experiencing Issue
2/2
Average Importance Score
5.00

avatar toivo toivo - open - 4 Apr 2022
avatar toivo toivo - change - 4 Apr 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Apr 2022
avatar toivo
toivo - comment - 4 Apr 2022

Screenshots from received email in Joomla 4.1.3-dev and Joomla 3.10.8:

screen shot 2022-04-04 at 05 07 09screen shot 2022-04-04 at 05 07 09


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

avatar toivo
toivo - comment - 5 Apr 2022

The original report in the Joomla forum mentions "when "Reply to Email" / "Reply to Name" are set, they are not coded by Joomla 4 in the test message or any of Joomla 4 email templates."

I verified this by testing the Account Details message for a new user in Joomla 4.1.3-dev and Joomla 3.10.8.

Just a guess but maybe the issue originates from the processing of the email templates, introduced in Joomla 4.


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

avatar toivo toivo - change - 5 Apr 2022
The description was changed
Title
[4.1]Email headers missing Reply To and Reply To Name
[4.1][Mail Templates?] Email headers missing Reply To and Reply To Name
avatar toivo toivo - edited - 5 Apr 2022
avatar toivo toivo - edited - 5 Apr 2022
avatar Fedik
Fedik - comment - 6 Apr 2022

Yeah, there a diference, J3 use $mail->sendMail(), wich care about ReplyTo:

// Take care of reply email addresses
if (is_array($replyTo))
{
$numReplyTo = count($replyTo);
for ($i = 0; $i < $numReplyTo; $i++)
{
if ($this->addReplyTo($replyTo[$i], $replyToName[$i]) === false)
{
return false;
}
}
}
elseif (isset($replyTo))
{
if ($this->addReplyTo($replyTo, $replyToName) === false)
{
return false;
}
}
elseif ($config->get('replyto'))
{
$this->addReplyTo($config->get('replyto'), $config->get('replytoname'));
}
// Add sender to replyTo only if no replyTo received
$autoReplyTo = (empty($this->ReplyTo)) ? true : false;

However in J4 we use MailTemplate that use own send() method, where global ReplyTo is ignored:

if ($this->replyto)
{
$this->mailer->addReplyTo($this->replyto->mail, $this->replyto->name);
}

avatar Fedik Fedik - change - 6 Apr 2022
Labels Added: bug
avatar Fedik Fedik - labeled - 6 Apr 2022
avatar toivo
toivo - comment - 6 Apr 2022

@Fedik thank you for the explanation. Shouldn't Mail Templates behave the same way as mail in Joomla 3 and use the global settings Reply To and Reply To Name?


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

avatar Fedik
Fedik - comment - 6 Apr 2022

I also think it should use global setings when "local" not exists for ReplyTo.

avatar chmst chmst - change - 31 Aug 2022
Labels Added: J4 Issue
avatar chmst chmst - labeled - 31 Aug 2022
avatar cathelin45
cathelin45 - comment - 16 Feb 2023

Hi,
Is there a way to know when that bug will be corrected? It is still the same problem with Joomla version 4.2.8
Thanks


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

avatar toivo
toivo - comment - 18 Feb 2023

@cathelin45 no indication until one of the developers creates a Pull Request (PR). Two successful tests are required before the fix is included in the next version.

A related issue was reported today with the current version of VirtueMart, 4.0.12.10777. VirtueMart sets the Reply-To header by calling the function addReplyTo() in libraries/src/Mail/Mail.php, which then passes the details to the addReplyTo() function in the PHPMailer library, but PHPMailer rejects the email address:
0 - Invalid address: (Reply-To)

I will try to test this last use case with VirtueMart, narrow it down and get more details. The forum topic is
Issue with Reply-To address in PHPMailer with VirtueMart


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37473.
avatar toivo
toivo - comment - 18 Feb 2023

It turns out that the Reply-To email address forwarded by VirtueMart's Recommend to Friend form via Joomla addReplyTo() to addReplyTo() in PHPMailer must have been blank, which explains the error message.


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

avatar toivo
toivo - comment - 19 Feb 2023

@Fedik @cathelin45,
Just tested a patch in Joomla 4.2.8-dev (shouldn be called 4.2.9-dev?) of 19 February. It worked with the Sent Test Mail and the Forgot Your Password email.

libraries/src/Mail/MailTemplate.php lines 279-281:

        if ($this->replyto) {
            $this->mailer->addReplyTo($this->replyto->mail, $this->replyto->name);
        }

change to:

	if ($this->replyto) {
            $this->mailer->addReplyTo($this->replyto->mail, $this->replyto->name);
        } elseif ($app->get('replyto')) {
            $this->mailer->addReplyTo($app->get('replyto'), $app->get('replytoname'));		
	}
```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/37473">issues.joomla.org/tracker/joomla-cms/37473</a>.</sub>
avatar Fedik
Fedik - comment - 19 Feb 2023

@toivo that should work I think

avatar toivo
toivo - comment - 19 Feb 2023

@Fedik would you like to create a PR from that? I do not have the tools or skills to do that.


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

avatar Fedik
Fedik - comment - 19 Feb 2023

I will try over the week, if no one will be faster

avatar toivo
toivo - comment - 19 Feb 2023

@Fedik thank you!

On Mon, Feb 20, 2023, 12:25 AM Fedir Zinchuk @.***>
wrote:

I will try over the week, if no one will be faster


Reply to this email directly, view it on GitHub
#37473 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAI64J2VRPIBD6HYJEMMWOTWYINMRANCNFSM5SOKI3OA
.
You are receiving this because you were mentioned.Message ID:
@.***>

avatar cathelin45
cathelin45 - comment - 19 Feb 2023

Thank you!


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

avatar cathelin45
cathelin45 - comment - 19 Feb 2023

Hi Toivo,
Many thanks for that. "Reply to" is now correctly coded with you patch; it now works alright.


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

avatar Fedik Fedik - change - 20 Feb 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-02-20 09:32:03
Closed_By Fedik
avatar Fedik Fedik - close - 20 Feb 2023
avatar Fedik
Fedik - comment - 20 Feb 2023

Please test #39893

Add a Comment

Login with GitHub to post a comment