-# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
+# Copyright (C) 2013-2015 all contributors <meta@public-inbox.org>
# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
use strict;
use warnings;
'Content-Type' => 'text/html',
Subject => 'HTML only badness',
],
- body => "<html><body>bad body</body></html>\n",
+ body => "<html><body>bad body\r\n</body></html>\n",
);
is(1, PublicInbox::Filter->run($s), "run was a success");
unlike($s->as_string, qr/<html>/, "HTML removed");
is("text/plain", $s->header("Content-Type"),
"content-type changed");
like($s->body, qr/\A\s*bad body\s*\z/, "body");
+ unlike($s->body, qr/\r/, "body has no cr");
like($s->header("X-Content-Filtered-By"),
qr/PublicInbox::Filter/, "XCFB header added");
}
like($s->as_string, qr/scrubbed/, "scrubbed message");
}
-{
- my $s = Email::MIME->create(
- header => [
- From => 'a@example.com',
- To => 'b@example.com',
- 'Content-Type' => 'text/plain',
- 'Mail-Followup-To' => 'c@example.com',
- Subject => 'mfttest',
- ],
- body => "mft\n",
- );
-
- is('c@example.com', $s->header("Mail-Followup-To"),
- "mft set correctly");
- is(1, PublicInbox::Filter->run($s), "run succeeded for mft");
- is(undef, $s->header("Mail-Followup-To"), "mft stripped");
-}
-
# multi-part with application/octet-stream
{
my $os = 'application/octet-stream';