No Code Attached Yet bug
avatar vicn1222
vicn1222
26 Oct 2023

Steps to reproduce the issue

Install Joomla as default.
Global Configuration -> Server -> Mailer = "PHP Mail".

"Forgot your password" unable to send email.

Expected result

Email should be sent

Actual result

No email is sent

System information (as much as possible)

Joomla 5.0
Red Hat RHEL 9

Additional comments

The cause

In file libraries/src/Mail/MailerFactory.php, line 83

 if ($mailer->setFrom($mailfrom, MailHelper::cleanLine($fromname), false) === false) {

needs to be changed to

 if ($mailer->setFrom($mailfrom, MailHelper::cleanLine($fromname), true) === false) {

The php "mail" needs $additional_params = "-fsupport@mydomain.com"

mail(
    string $to,
    string $subject,
    string $message,
    array|string $additional_headers = [],
    string $additional_params = ""
): bool
avatar vicn1222 vicn1222 - open - 26 Oct 2023
avatar vicn1222 vicn1222 - change - 26 Oct 2023
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 26 Oct 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Oct 2023
avatar vicn1222
vicn1222 - comment - 26 Oct 2023

Looking at the maillog, without the $additional_params = "-fsupport@mydomain.com", the sender email becomes

from=apache@T140.localdomain

Oct 26 14:47:52 T140 postfix/qmgr[1679]: 4A0FE803386F4: from=<apache@T140.localdomain>, size=957, nrcpt=1 (queue active)

The email is then rejected by gmail-smtp-in.l.google.com with message

This mail has been blocked because the sender is unauthenticated. 550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM. 550-5.7.26  550-5.7.26  Authentication results: 550-5.7.26  DKIM = did not pass 550-5.7.26  SPF [t140.localdomain]

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42222.
avatar Hackwar Hackwar - change - 27 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 27 Mar 2024

Add a Comment

Login with GitHub to post a comment