MIME headers should be MIME encoded. Fixes bug #11089.
This commit is contained in:
parent
af447ea570
commit
636ed5ce9a
3 changed files with 17 additions and 3 deletions
|
|
@ -19,7 +19,7 @@ use Test::More;
|
|||
use Test::Deep;
|
||||
use Data::Dumper;
|
||||
use MIME::Parser;
|
||||
use Encode qw/decode/;
|
||||
use Encode qw/decode encode/;
|
||||
|
||||
use WebGUI::Test;
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ if ( $@ ) { diag( "Can't prepare mail server: $@" ) }
|
|||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
||||
plan tests => 16; # Increment this number for each test you create
|
||||
plan tests => 17; # Increment this number for each test you create
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Test create
|
||||
|
|
@ -115,6 +115,18 @@ is( $mime->parts(0)->as_string =~ m/\n/, $newlines,
|
|||
"addHtmlRaw should add newlines after 78 characters",
|
||||
);
|
||||
|
||||
use utf8;
|
||||
$mail = WebGUI::Mail::Send->create( $session, {
|
||||
to => 'norton@localhost',
|
||||
subject => "H\x{00C4}ufige Fragen",
|
||||
});
|
||||
$mail->addHeaderField('List-ID', "H\x{00C4}ufige Fragen");
|
||||
my $messageId = $mail->queue;
|
||||
diag $messageId;
|
||||
my $dbMail = WebGUI::Mail::Send->retrieve($session, $messageId);
|
||||
diag ref $dbMail;
|
||||
is($dbMail->getMimeEntity->head->get('List-ID'), "=?UTF-8?Q?H=C3=84ufige=20Fragen?=\n", 'addHeaderField: handles utf-8 correctly');
|
||||
|
||||
# TODO: Test that addHtml creates a body with the right content type
|
||||
my $smtpServerOk = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue