about summary refs log tree commit homepage
path: root/t/mid.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-04-20 03:27:37 +0000
committerEric Wong <e@80x24.org>2018-04-20 03:27:53 +0000
commit0ef5872cee83f07c9ae7afceb2e92257507dc3ca (patch)
tree5464f1ae1d633a31cdf4bcb9808e5a66f3113528 /t/mid.t
parente350de7fdbe12dafc36e893e66ce8c93ec6dc3f2 (diff)
downloadpublic-inbox-0ef5872cee83f07c9ae7afceb2e92257507dc3ca.tar.gz
For Subject/To/Cc/From headers, we squeeze them to a space (' ').

For Message-IDs (including References/In-Reply-To), '\t', '\n', '\r'
are deleted since some MUAs might screw them up:

  https://public-inbox.org/git/656C30A1EFC89F6B2082D9B6@localhost/raw
Diffstat (limited to 't/mid.t')
-rw-r--r--t/mid.t11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/mid.t b/t/mid.t
index 223be798..8c307c82 100644
--- a/t/mid.t
+++ b/t/mid.t
@@ -25,6 +25,17 @@ is(mid_escape('foo%!@(bar)'), 'foo%25!@(bar)');
         $mime->header_set('In-Reply-To', '<weld>');
         is_deeply(['hello', 'world', 'weld'], references($mime->header_obj),
                 'references combines with In-Reply-To');
+
+        $mime->header_set('References', "<hello>\n\t<world>");
+        $mime->header_set('In-Reply-To');
+        is_deeply(references($mime->header_obj), ['hello', 'world'],
+                'multiline References OK');
+        $mime->header_set('References', "<hello\tworld>");
+        is_deeply(references($mime->header_obj), ['helloworld'],
+                'drop \t in References <656C30A1EFC89F6B2082D9B6@localhost>');
+        $mime->header_set('Message-ID', "<hello\tworld>");
+        is_deeply(mids($mime->header_obj), ['helloworld'],
+                'drop \t in Message-ID');
 }
 
 done_testing();