* [PATCH 4/4] import: allow messages without subject
2016-06-19 0:28 4% [PATCH 0/4] watch improvements for mirroring Eric Wong
@ 2016-06-19 0:28 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-06-19 0:28 UTC (permalink / raw)
To: meta
Because our WatchMaildir module is liberal about what
it accepts, we can potentially have messages without a
subject.
---
lib/PublicInbox/Import.pm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index c13d483..5ffc26e 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -112,8 +112,11 @@ sub remove {
defined($n) or die "read final byte of cat-blob failed: $!";
die "bad read on final byte: <$lf>" if $lf ne "\n";
my $cur = Email::MIME->new($buf);
- if ($cur->header('Subject') ne $mime->header('Subject') ||
- norm_body($cur) ne norm_body($mime)) {
+ my $cur_s = $cur->header('Subject');
+ $cur_s = '' unless defined $cur_s;
+ my $cur_m = $mime->header('Subject');
+ $cur_m = '' unless defined $cur_m;
+ if ($cur_s ne $cur_m || norm_body($cur) ne norm_body($mime)) {
return ('MISMATCH', $cur);
}
^ permalink raw reply related [relevance 7%]
* [PATCH 0/4] watch improvements for mirroring
@ 2016-06-19 0:28 4% Eric Wong
2016-06-19 0:28 7% ` [PATCH 4/4] import: allow messages without subject Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-06-19 0:28 UTC (permalink / raw)
To: meta
public-inbox-watch is more liberal than public-inbox-mda,
so we need to make some adjustments about how it handles
messages with missing Message-IDs, Subjects, and such.
Eric Wong (4):
emergency: avoid needless mkpath dependency
watch_maildir: add scan test
watch_maildir: spam removal support
import: allow messages without subject
lib/PublicInbox/Emergency.pm | 4 +-
lib/PublicInbox/Import.pm | 7 +-
lib/PublicInbox/WatchMaildir.pm | 141 ++++++++++++++++++++++++++++++----------
t/watch_maildir.t | 83 +++++++++++++++++++++++
4 files changed, 197 insertions(+), 38 deletions(-)
^ permalink raw reply [relevance 4%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-06-19 0:28 4% [PATCH 0/4] watch improvements for mirroring Eric Wong
2016-06-19 0:28 7% ` [PATCH 4/4] import: allow messages without subject Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).