4 use RT::Test tests => undef;
7 my $queue = RT::Test->load_or_create_queue( Name => 'General' );
8 ok $queue->id, 'loaded queue';
14 Content-type: text/plain; charset="not-supported-encoding"
22 ($stat, $id) = RT::Test->send_via_mailgate($mail);
23 is( $stat >> 8, 0, "The mail gateway exited normally" );
24 ok( $id, "created ticket" );
25 } qr/Encoding 'not-supported-encoding' is not supported/;
27 my $ticket = RT::Ticket->new( RT->SystemUser );
29 ok $ticket->id, "loaded ticket";
31 my $txn = $ticket->Transactions->First;
32 ok !$txn->ContentObj, 'no content';
34 my $attach = $txn->Attachments->First;
35 like $attach->Content, qr{ho hum just some text}, 'attachment is there';
36 is $attach->GetHeader('Content-Type'),
37 'application/octet-stream; charset="not-supported-encoding"',
38 'content type is changed'
40 is $attach->GetHeader('X-RT-Original-Content-Type'),
42 'original content type is saved'
49 Subject: =?not-supported?Q?=07test=A9?=
50 Content-type: text/plain; charset="ascii"
58 ($stat, $id) = RT::Test->send_via_mailgate($mail);
59 is( $stat >> 8, 0, "The mail gateway exited normally" );
60 ok( $id, "created ticket" );
61 } qr/Charset 'not-supported' is not supported/;
63 my $ticket = RT::Ticket->new( RT->SystemUser );
65 ok $ticket->id, "loaded ticket";
66 is $ticket->Subject, "\x{FFFD}test\x{FFFD}";