about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-17 09:14:48 +0000
committerEric Wong <e@80x24.org>2020-12-31 00:01:42 +0000
commite5d32fe689dd0922eaf206e2371fc8040ad85247 (patch)
treee0778555ba93b48aed285a51aaedcda78dc3faf2
parentfdbd73069af6eed90030f97def61e669d8d0dc4c (diff)
downloadpublic-inbox-e5d32fe689dd0922eaf206e2371fc8040ad85247.tar.gz
It's actually supported by mutt, dovecot[1], and likely some other
software to augment the Status: header.  While dovecot doesn't
expose X-Status to clients, mutt will write 'A' (answered) and
'F' to X-Status (but not T (draft)).

So we'll drop it like we do Status since it's not suitable for
public mail, but stick it in an @UNWANTED_HEADERS array will
allow us to configure an override if needed.

[1]  https://doc.dovecot.org/configuration_manual/mail_location/mbox/
-rw-r--r--lib/PublicInbox/Import.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index 1a226cc7..2cb4896a 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -328,11 +328,13 @@ sub extract_cmt_info ($;$) {
 }
 
 # kill potentially confusing/misleading headers
+our @UNWANTED_HEADERS = (qw(Bytes Lines Content-Length),
+                        qw(Status X-Status));
 sub drop_unwanted_headers ($) {
-        my ($mime) = @_;
-
-        $mime->header_set($_) for qw(Bytes Lines Content-Length Status);
-        $mime->header_set($_) for @PublicInbox::MDA::BAD_HEADERS;
+        my ($eml) = @_;
+        for (@UNWANTED_HEADERS, @PublicInbox::MDA::BAD_HEADERS) {
+                $eml->header_set($_);
+        }
 }
 
 # used by V2Writable, too