Subject: | Obsolete phrase support |
Date: | Sat, 11 Nov 2006 15:06:46 +0000 |
To: | "rjbs [...] cpan.org via RT" <bug-Email-Address [...] rt.cpan.org> |
From: | Simon Cozens <simon [...] simon-cozens.org> |
Apple Mail, dreck that it is, appears to produce From lines like the following:
From: Aye B. Cee <abc@test.com>
as of at least 2.752.3
Now this really ought to be quoted, according to RFC2822, but there is
grandfathered support for this behaviour:
obs-phrase = word *(word / "." / CFWS)
phrase = 1*word / obs-phrase
display-name = phrase
Email::Address should therefore pander to the stupidity of developers by
similarly grandfathering this kind of non-quoted phrase. To do this, replace
the definition of $phrase with:
my $obs_phrase = qr/$word(?:$word|\.|$cfws)*/;
my $phrase = qr/$obs_phrase|(?:$word+)/;
For your test suite:
[
'Jason W. May <jmay-- ATAT --pobox.com>',
[
[
'Jason W. May',
'jmay-- ATAT --pobox.com',
undef
]
]
],
--
A person is smart. People are dumb, panicky dangerous animals and you know it.
- Agent J, Men in Black