unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] import: drop X-Status in addition to Status
Date: Thu, 17 Dec 2020 09:14:48 +0000	[thread overview]
Message-ID: <20201217091448.5708-1-e@80x24.org> (raw)

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/
---
 lib/PublicInbox/Import.pm | 10 ++++++----
 1 file 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

                 reply	other threads:[~2020-12-17  9:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201217091448.5708-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).