markov2 / perl5-Mail-Message

Processing MIME messages
http://perl.overmeer.net/CPAN
1 stars 1 forks source link

Mail::Message::Field::Address - long phrases with brackets #2

Closed abeverley closed 2 years ago

abeverley commented 2 years ago

Phrases with brackets do not appear to be encoded correctly as quoted-printable by Mail::Message::Field::Address. This only seems to happen under certain circumstances, with particularly long phrases. The following demonstrates the problem:

my $f = Mail::Message::Field::Address->new(
    address => 'andy@example.com',
    phrase  => 'John Smith with a long long long long phrase (via test list)',
);

my $new = Mail::Message::Field::Address->parse("$f");
print $new->phrase; # Prints ?=
markov2 commented 2 years ago

When parsing an unquoted phrase, some characters permitted inside =?.*?= can be confused with their special meaning in the email syntax (in this case, the parenthesis are assigned for comments) The initial grabbing of the phrase is smarter now.

https://github.com/markov2/perl5-Mail-Message/commit/3e0c8e178d45223c83524e4b2056cef9aec7c790

markov2 commented 2 years ago

Ah. stupid of me: accidentally removed the last test in the final clean-up Thanks for reporting.

abeverley commented 2 years ago

Thanks Mark.