about summary refs log tree commit homepage
path: root/script/public-inbox-edit
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2019-06-10 18:09:27 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2019-06-10 18:15:40 +0000
commitd377a9d2f972f85edf759a6c152ca49078baba38 (patch)
treef83132370d608745f31b72482a379c11c8fbbc3f /script/public-inbox-edit
parent6e507c8cb41b0d48963503a88034348d74506211 (diff)
downloadpublic-inbox-d377a9d2f972f85edf759a6c152ca49078baba38.tar.gz
mutt will set Content-Length, Lines, and Status headers
unconditionally, so we need to account for that before
doing header comparisons to avoid making expensive changes
when noop edits are made.
Diffstat (limited to 'script/public-inbox-edit')
-rwxr-xr-xscript/public-inbox-edit6
1 files changed, 6 insertions, 0 deletions
diff --git a/script/public-inbox-edit b/script/public-inbox-edit
index 7a534cc2..16d78529 100755
--- a/script/public-inbox-edit
+++ b/script/public-inbox-edit
@@ -14,6 +14,7 @@ use PublicInbox::MID qw(mid_clean mids);
 PublicInbox::Admin::check_require('-index');
 require PublicInbox::MIME;
 require PublicInbox::InboxWritable;
+require PublicInbox::Import;
 
 my $usage = "$0 -m MESSAGE_ID [--all] [INBOX_DIRS]";
 my $opt = { verbose => 1, all => 0, -min_inbox_version => 2, raw => 0 };
@@ -197,6 +198,11 @@ W: possible message boundary splitting error
         my $new_mime = PublicInbox::MIME->new(\$new_raw);
         my $old_mime = PublicInbox::MIME->new($old_raw);
 
+        # make sure we don't compare unwanted headers, since mutt adds
+        # Content-Length, Status, and Lines headers:
+        PublicInbox::Import::drop_unwanted_headers($new_mime);
+        PublicInbox::Import::drop_unwanted_headers($old_mime);
+
         # allow changing Received: and maybe other headers which can
         # contain sensitive info.
         my $nhdr = $new_mime->header_obj;