]> Sergey Matveev's repositories - public-inbox.git/commitdiff
drop Mail-Followup-To, Mail-Reply-To, and Reply-To
authorEric Wong <normalperson@yhbt.net>
Tue, 14 Jan 2014 23:35:21 +0000 (23:35 +0000)
committerEric Wong <normalperson@yhbt.net>
Tue, 14 Jan 2014 23:35:21 +0000 (23:35 +0000)
Due to the higher latency of a pull-based email, we want to
encourage the use of reply-to-all for public-inbox.

lib/PublicInbox/Filter.pm
t/filter.t

index 6cccd930862c363ab61393d05158e53ceb8b382a..a83ecc83088b696e71f24ab9d7d1f9ed8623c746 100644 (file)
@@ -26,7 +26,10 @@ sub run {
        # kill potentially bad/confusing headers
        # Note: ssoma already does this, but since we mangle the message,
        # we should do this before it gets to ssoma.
-       foreach my $d (qw(status lines content-length)) {
+       # We also kill Mail-{Followup,Reply}-To and Reply-To headers due to
+       # the nature of public-inbox having no real subscribers.
+       foreach my $d (qw(status lines content-length
+                       mail-followup-to mail-reply-to reply-to)) {
                $simple->header_set($d);
        }
 
index 9c71b11f735a5bd7b6c8acd57f212ce9498edca6..12f4ed6f1f84e52ace60eab5591d23b8b38c7773 100644 (file)
@@ -259,4 +259,24 @@ sub count_body_parts {
        like($f->simple->as_string, qr/scrubbed/, "scrubbed message");
 }
 
+{
+       my $s = Email::Simple->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");
+       my $f = Email::Filter->new(data => $s->as_string);
+       is(1, PublicInbox::Filter->run($f->simple), "run succeeded for mft");
+       is(undef, $f->simple->header("Mail-Followup-To"), "mft stripped");
+}
+
+
 done_testing();