Subject: | Incorrect use of MIME-Q encoding on (some) headers |
RFC2047 states that MIME-Q encoding MUST NOT appear in any portion of an 'addr-spec'.
However all headers passed via the header_str attribute in the call to Email::MIME->create( ) get
MIME-Q encoded [1]. This causes long addresses to have spaces inserted within them (before
any folding takes place).
A simple (failing) test case is attached to highlight this.
Cheers,
Russell.
[1] I'm using Email::MIME::Kit to do the heave lifting of the email generation, which passes
headers via the header_str attribute..
Subject: | fold.t |
#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 1;
use Email::MIME;
use Email::Simple;
my $address = 'this-is-a-very-very-very-very-very-very-very-very-very-long-address@some.domain.name';
my $header = [ 'To' => $address ];
my $body = '...';
my $email = Email::MIME->create(
header_str => $header,
body => $body,
);
like($email->as_string, qr/$address/,"Email::MIME - To: address is correct (no MIME-Q encoding)");