No Code Attached Yet Information Required
avatar RobWilkinsonUK
RobWilkinsonUK
22 Dec 2022

PHPMail is rejected by the mail server with an "overlength date field" error when using PHP 8.X. Using PHP 7.4 does not produce the error

Steps to reproduce the issue
Set mail as PHPMail in Global Configuration and set PHP to 8.X

goto "Forgot Logon" and try to get a new password.

Email will be rejected

Expected result

Actual result

System information (as much as possible)

Additional comments

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar RobWilkinsonUK RobWilkinsonUK - open - 22 Dec 2022
avatar RobWilkinsonUK RobWilkinsonUK - change - 22 Dec 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 22 Dec 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Dec 2022
avatar brianteeman
brianteeman - comment - 22 Dec 2022

which EXACT version of php please

avatar RobWilkinsonUK
RobWilkinsonUK - comment - 22 Dec 2022

Both 8.0 and 8.1

avatar RobWilkinsonUK
RobWilkinsonUK - comment - 22 Dec 2022

PHP Mail successfuly sends a "test" email.
SMTP mail works successfully

avatar RobWilkinsonUK
RobWilkinsonUK - comment - 22 Dec 2022

Here is the error messge received:


This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

Rob@RobWilkinson.US
This message has been rejected because it has
an overlength date field which can be used
to subvert Microsoft mail programs
The following URL has further information
http://www.securityfocus.com/frames/?content=/templates/article.html%3Fid%3D61

avatar brianteeman
brianteeman - comment - 22 Dec 2022

Sounds like a configuration issue on the server with php 8
Possibly there is no default timezone set
This is something you would need to check with your host

avatar RobWilkinsonUK
RobWilkinsonUK - comment - 22 Dec 2022

I will do that (Check with Hostgator) but why would it work for SMTP Mail and not PHPMail because of that?
Regards,
Rob

avatar RobWilkinsonUK
RobWilkinsonUK - comment - 22 Dec 2022

And why would there be success sending a test email but a rejected mail for the logon email?
REgards,
ROb

avatar RobWilkinsonUK
RobWilkinsonUK - comment - 22 Dec 2022

Hi BrianL
Having reflected on this I have a question. if a mail server is relying on there to be a valid date in the message and Joomla/phpmail is not providing that valid date, why is that not a bug? Is it not a part of the protocol? Either the host mail server, as you suggest, is not following the protocol or joomla/php mail is not.
Regards,
Rob

avatar brianteeman
brianteeman - comment - 22 Dec 2022

IF my guess was correct then the problem is with the php confiuguration on the server which is not something joomla or phpmail can do anything about. My guess is based purely on other reports online of this same issue which are not using joomla and in some cases no using phpmail. But were all related to a new version of php which strongly suggests the date value in the php configuration.

avatar RobWilkinsonUK
RobWilkinsonUK - comment - 22 Dec 2022

Hi Brian:
To me it would be strange if there was a mail server dependency for Joomla to work properly or qually if there is a PHP configuration dependency. If such a dependency exists then it ought to be prominently identified somewhere.
Regards,
Rob

avatar brianteeman
brianteeman - comment - 23 Dec 2022

I am only making a suggestion for you to investigate further - not interested in a debate

avatar RobWilkinsonUK
RobWilkinsonUK - comment - 23 Dec 2022

My apologies. I thought we were having a technical discussion.

avatar joomdonation
joomdonation - comment - 23 Dec 2022

@RobWilkinsonUK Base on the error message, I guess there is something wrong with Date header of the email sent from your site somehow. Normally, value for that Date header is something like Fri, 23 Dec 2022 23:14:20 +0700, it is returned by this PHP code in PHPMailer library (which Joomla is using for sending email)

public static function rfcDate()
{
	//Set the time zone to whatever the default is to avoid 500 errors
	//Will default to UTC if it's not set properly in php.ini
	date_default_timezone_set(@date_default_timezone_get());

	return date('D, j M Y H:i:s O');
}

Maybe there is something wrong with PHP setting on the server (could be related to date.timezone setting in php.ini) and it causes the above code does not return datetime in expected format.

So in this case, you should contact your hosting provider, ask them to check to see what's wrong with the mail sent from your site. If they said something wrong with Date header of the email as I guessed above, ask them to see what's the value set by Joomla in that email and what's wrong. Ask them to check date.timezone setting to see if it is valid and get back to us with their response. Without their answers, it's hard for us to know what's wrong to find a solution

(It is very likely it is an issue with the server because there are many users use Joomla on PHP 8 already, so if this is an issue from Joomla itself, we would have received many bug reports)

avatar Quy Quy - change - 31 Dec 2022
Labels Added: Information Required
avatar Quy Quy - labeled - 31 Dec 2022
avatar brianteeman
brianteeman - comment - 2 Jan 2023

Did you get any response from your host about the php version having a timezone set or not?

avatar brianteeman
brianteeman - comment - 6 Feb 2023

I guess this can be closed now

avatar RobWilkinsonUK
RobWilkinsonUK - comment - 6 Feb 2023

I guess, Brian. I worked around it using smtp.Regards RobSent from my iPadOn Feb 6, 2023, at 5:25 AM, Brian Teeman @.***> wrote:
I guess this can be closed now

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

avatar joomdonation
joomdonation - comment - 7 Feb 2023

Closing as state above. Thanks @RobWilkinsonUK for the feedback and thanks @brianteeman for keep monitoring the issue.

avatar joomdonation joomdonation - change - 7 Feb 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-02-07 15:41:31
Closed_By joomdonation
avatar joomdonation joomdonation - close - 7 Feb 2023

Add a Comment

Login with GitHub to post a comment