]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/filter.t
emergency: implement new emergency Maildir delivery
[public-inbox.git] / t / filter.t
index e4f6a2b09ada860fff07b12ed4d8da292610c56d..609a19297f3b4094db0326754f998442a57e2d77 100644 (file)
@@ -1,4 +1,4 @@
-# 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;
@@ -85,13 +85,14 @@ sub count_body_parts {
                        '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");
 }
@@ -296,24 +297,6 @@ sub count_body_parts {
        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';