diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-20 19:50:03 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-20 19:52:30 +0000 |
commit | baae46ba22d283706dd821bea19aa9d985d0081d (patch) | |
tree | 27401e3e1afbcb0079e25f5e9c49864301d3e8eb | |
parent | 70207d974c5a965ef849b58c27b63fd644b3293e (diff) | |
download | public-inbox-baae46ba22d283706dd821bea19aa9d985d0081d.tar.gz |
Reduce the places where we have duplicate logic for discarding unwanted headers.
-rw-r--r-- | lib/PublicInbox/Import.pm | 2 | ||||
-rw-r--r-- | lib/PublicInbox/MDA.pm | 2 | ||||
-rw-r--r-- | lib/PublicInbox/WatchMaildir.pm | 1 |
3 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index fc740fa4..e50f1156 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -13,6 +13,7 @@ use PublicInbox::MID qw(mids mid_mime mid2path); use PublicInbox::Address; use PublicInbox::MsgTime qw(msg_timestamp); use PublicInbox::ContentId qw(content_digest); +use PublicInbox::MDA; sub new { my ($class, $git, $name, $email, $ibx) = @_; @@ -319,6 +320,7 @@ sub add { # kill potentially confusing/misleading headers $mime->header_set($_) for qw(bytes lines content-length status); + $mime->header_set($_) for @PublicInbox::MDA::BAD_HEADERS; # spam check: if ($check_cb) { diff --git a/lib/PublicInbox/MDA.pm b/lib/PublicInbox/MDA.pm index d5af8f94..637404eb 100644 --- a/lib/PublicInbox/MDA.pm +++ b/lib/PublicInbox/MDA.pm @@ -81,8 +81,6 @@ sub set_list_headers { $pa =~ tr/@/./; # RFC2919 $simple->header_set("List-Id", "<$pa>"); } - - $simple->header_set($_) foreach @BAD_HEADERS; } 1; diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index b165a603..d3ca2a16 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -159,7 +159,6 @@ sub _try_path { } my $im = _importer_for($self, $inbox); my $mime = _path_to_mime($path) or return; - $mime->header_set($_) foreach @PublicInbox::MDA::BAD_HEADERS; my $wm = $inbox->{-watchheader}; if ($wm) { my $v = $mime->header_obj->header_raw($wm->[0]); |