4 use RT::Test tests => 12;
7 my ($baseurl, $m) = RT::Test->started_ok;
9 diag "Testing non-ASCII latin1 in From: header";
11 my $mail = Encode::encode( 'iso-8859-1', Encode::decode( "UTF-8", <<'.') );
12 From: <René@example.com>
13 Reply-To: =?iso-8859-1?Q?Ren=E9?= <René@example.com>
14 Subject: testing non-ASCII From
15 Content-Type: text/plain; charset=iso-8859-1
21 warnings_like { ( $status, $id ) = RT::Test->send_via_mailgate($mail) }
22 [(qr/Unable to parse an email address from/) x 2,
23 qr/Couldn't parse or find sender's address/
25 'Got parse error for non-ASCII in From';
27 local $TODO = "Currently don't handle non-ASCII for sender";
28 is( $status >> 8, 0, "The mail gateway exited normally" );
29 ok( $id, "Created ticket" );
33 diag "Testing non-ASCII latin1 in From: header with MIME-word-encoded phrase";
35 my $mail = Encode::encode( 'iso-8859-1', Encode::decode( "UTF-8", <<'.') );
36 From: =?iso-8859-1?Q?Ren=E9?= <René@example.com>
37 Reply-To: =?iso-8859-1?Q?Ren=E9?= <René@example.com>
38 Subject: testing non-ASCII From
39 Content-Type: text/plain; charset=iso-8859-1
45 warnings_like { ( $status, $id ) = RT::Test->send_via_mailgate($mail) }
46 [(qr/Unable to parse an email address from/) x 2,
47 qr/Couldn't parse or find sender's address/
49 'Got parse error for iso-8859-1 in From';
51 local $TODO = "Currently don't handle non-ASCII in sender";
52 is( $status >> 8, 0, "The mail gateway exited normally" );
53 ok( $id, "Created ticket" );
61 Subject: testing non-ASCII From
62 Content-Type: text/plain; charset=iso-8859-1
68 warnings_like { ( $status, $id ) = RT::Test->send_via_mailgate($mail) }
69 [qr/Couldn't parse or find sender's address/],
70 'Got parse error with no sender fields';
71 is( $status >> 8, 1, "The mail gateway failed" );
72 ok( !$id, "No ticket created" );