+
+# test that if it gets base64 transfer-encoded long mail then it doesn't hang
+{
+ local $SIG{ALRM} = sub {
+ ok 0, "timed out, web server is probably in deadlock";
+ exit;
+ };
+ alarm 30;
+ $buf = encode_base64('a'x(250*1024));
+ $mail = RT::Test->open_mailgate_ok($baseurl);
+ print $mail <<"EOF";
+From: recipient\@example.com
+To: general\@$RT::rtname
+Content-transfer-encoding: base64
+Subject: Long not encrypted message for queue
+
+$buf
+EOF
+ RT::Test->close_mailgate_ok($mail);
+ alarm 0;
+
+ my $tick = RT::Test->last_ticket;
+ is( $tick->Subject, 'Long not encrypted message for queue',
+ "Created the ticket"
+ );
+ my $content = $tick->Transactions->First->Content;
+ like $content, qr/a{1024,}/, 'content is not lost';
+}