SpamAssasin complains that the date format is wrong.
0.4 INVALID_DATE Invalid Date: header (not RFC 2822)
Supplied date is:
Date: Sat, 30 Apr 2022 11:20:15 0200
as a result of mail PHP script code:
$this->_add_hdr(‘Date’, sprintf(date(DateTime::RFC2822)));
or
$this->_add_hdr(‘Date’, sprintf(date(“D, d M Y H:i:s O”)));
(it seems to display same format no matter which line i use)
Do you have an idea how that PHP code line should look like so the error does not appear?
This is (to me at least) an odd usage of sprintf, where you’re putting the actual text string you want “printed” as the format parameter to sprintf. It’s parsing that string, and a “+” (or “-” ) will be used as formatting info, not output. I would replace it with this:
I have tried that, line being: $this->_add_hdr('Date', sprintf("%s",date("D, d M Y H:i:s O")));
Result:
Date: Sat, 30 Apr 2022 15:31:47 0200
and the warning mentioned in 1st post remains… I am using that sprintf because i am not a developer, so if you have better idea how the line should look like?