4 use RT::Test tests => undef;
6 my $queue = RT::Test->load_or_create_queue( Name => 'General' );
7 ok $queue->id, 'loaded queue';
9 my ($ok, $msg) = $queue->AddWatcher(
11 Email => 'test@example.com',
17 Subject: I like inline dispositions and I cannot lie
18 Content-type: multipart/related; boundary="foo"
21 Content-type: text/plain; charset="UTF-8"
26 Content-type: text/x-patch; name="filename.patch"
27 Content-disposition: inline; filename="filename.patch"
36 my $rt = send_and_receive($mail);
37 like $rt, qr/Content-Disposition:\s*inline.+?filename\.patch/is, 'found inline disposition';
42 $mail =~ s/(?<=Content-disposition: )inline/attachment/i;
44 my $rt = send_and_receive($mail);
45 like $rt, qr/Content-Disposition:\s*attachment.+?filename\.patch/is, 'found attachment disposition';
50 $mail =~ s/^Content-disposition: .+?\n(?=\n)//ism;
52 my $rt = send_and_receive($mail);
53 like $rt, qr/Content-Disposition:\s*attachment.+?filename\.patch/is, 'found default (attachment) disposition';
56 sub send_and_receive {
58 my ($stat, $id) = RT::Test->send_via_mailgate($mail);
59 is( $stat >> 8, 0, "The mail gateway exited normally" );
60 ok( $id, "created ticket" );
62 my @mails = RT::Test->fetch_caught_mails;
63 is @mails, 2, "got 2 outgoing emails";