Subject: | day-of-week is _optional_ in RFC 2822 and 822 |
RFC 2822 says:
date-time = [ day-of-week "," ] date FWS time [CFWS]
RFC 822 says:
date-time = [ day "," ] date time ; dd mm yy
; hh:mm:ss zzz
So the day of the week is clearly optional. The strict parser regexp
of DateTime::Format::Mail doesn't respect that, though. The included
patch corrects that.
Subject: | DateTime-Format-Mail-RFC2822-compliance-optional-day-of-week.patch |
--- /usr/share/perl5/DateTime/Format/Mail.pm 2006-06-19 19:29:37.000000000 +0000
+++ Mail.pm 2006-07-13 23:41:46.000000000 +0000
@@ -42,9 +42,10 @@
my $strict_RE = qr{
^ \s* # optional
# [day-of-week "," ]
- (?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) ,
+ (?:
+ (?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) , \s*
+ )?
# date => day month year
- \s+
(\d{1,2}) # day => 1*2DIGIT
\s+
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) # month-name