about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-04-12 10:01:01 +0000
committerEric Wong <e@80x24.org>2014-04-14 08:21:35 +0000
commite4fe464c207b2e2875618b14bf62712aa47b92c8 (patch)
tree8155a1d7a09d515cd6cd936c47b359c32b590e46
parent0bce6aa8226a955208d45c418adf9e0ac5ee8aa5 (diff)
downloadpublic-inbox-e4fe464c207b2e2875618b14bf62712aa47b92c8.tar.gz
These probably make sense even though we do not handle
delivery ourselves.  It can aid in searching/filtering/tagging
of messages.
-rwxr-xr-xpublic-inbox-mda15
1 files changed, 15 insertions, 0 deletions
diff --git a/public-inbox-mda b/public-inbox-mda
index 411ac15f..6e66fa71 100755
--- a/public-inbox-mda
+++ b/public-inbox-mda
@@ -42,6 +42,7 @@ if (PublicInbox->precheck($filter, $recipient) &&
                 # run spamc again on the HTML-free message
                 if (do_spamc($simple, \$filtered)) {
                         $simple = Email::Simple->new($filtered);
+                        set_list_headers($simple, $dst);
                         $filter->simple($simple);
 
                         my $from = $filter->from;
@@ -74,3 +75,17 @@ sub do_spamc {
 
         return ($@ || $? || !defined($$out) || length($$out) == 0) ? 0 : 1;
 }
+
+# RFC2919 and RFC2369
+sub set_list_headers {
+        my ($simple, $dst) = @_;
+        my $pa = "<$dst->{-primary_address}>";
+        $simple->header_set("List-Id", $pa);
+        $simple->header_set("List-Post", $pa);
+
+        my $url = $dst->{url};
+        if (defined $url) {
+                $simple->header_set("List-Archive", "<$url>");
+                $simple->header_set("List-Help", "<${url}help>");
+        }
+}