On Thu 29/Jan/2026 20:03:52 +0100 A. Schulze via mailop wrote:
John Levine via mailop:
It appears that A.Schulze via mailop <[email protected]> said:
Hello experts,
today, I found messages with this header:
Date: Wed Jan 28 14:46:29 CET 2026
You are correct, it's wrong.
- python3.13 say: valid -> email.utils.parsedate() does not return 'None'
I looked at the code and it's deliberate. There have been a lot of
mail programmers in the past that didn't read the spec, so it's
adapting to reality.
can you suggest an other way to check a date is a valid date-header
in this place: https://github.com/mail-de/mailheadercheck/
blob/6c65921c80fd0a75993ce9e55ede9a8a5d76e8e7/mailheaderchecklib/
utility.py#L134-L140
It's not a strict check, if that's what you're after.
Python 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from email.utils import parsedate
>>> parsedate('Wed Jan 28 14:46:29 CET 2026')
(2026, 1, 28, 14, 46, 29, 0, 1, -1)
Cannot use formatdate() to try to reproduce the same string, because it cannot
generate the same timezone.
Best
Ale
--
_______________________________________________
mailop mailing list
[email protected]
https://list.mailop.org/listinfo/mailop