user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/3] filter/vger: kill trailing newlines aggressively
  2021-02-12  7:05  6% [PATCH 0/3] MboxReader usage and changes Eric Wong
@ 2021-02-12  7:05  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-02-12  7:05 UTC (permalink / raw)
  To: meta

PublicInbox::MboxReader->(mboxrd|mboxo) only deletes the last
trailing newline, not every single trailing newline like
InboxWritable->import_mbox does.

Testing PublicInbox::MboxReader->mboxrd (next commit) with
scripts/import_vger_from_mbox on the LKML archive I got 2018 for
v2 development; this difference was responsible for a single
spam message(*) from out of 2722831 not being filtered correctly
and returning a different result.

(*) dated 2014-08-25
---
 lib/PublicInbox/Filter/Vger.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Filter/Vger.pm b/lib/PublicInbox/Filter/Vger.pm
index 0b1f5dd3..5b3c0277 100644
--- a/lib/PublicInbox/Filter/Vger.pm
+++ b/lib/PublicInbox/Filter/Vger.pm
@@ -24,7 +24,7 @@ sub scrub {
 	# the vger appender seems to only work on the raw string,
 	# so in multipart (e.g. GPG-signed) messages, the list trailer
 	# becomes invisible to MIME-aware email clients.
-	if ($s =~ s/$l0\n$l1\n$l2\n$l3\n($l4\n)?\z//os) {
+	if ($s =~ s/$l0\n$l1\n$l2\n$l3\n(?:$l4\n)?\n*\z//os) {
 		$mime = PublicInbox::Eml->new(\$s);
 	}
 	$self->ACCEPT($mime);

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/3] MboxReader usage and changes
@ 2021-02-12  7:05  6% Eric Wong
  2021-02-12  7:05  7% ` [PATCH 1/3] filter/vger: kill trailing newlines aggressively Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-02-12  7:05 UTC (permalink / raw)
  To: meta

*** BLURB HERE ***

Eric Wong (3):
  filter/vger: kill trailing newlines aggressively
  import_mbox: use MboxReader
  mbox_reader: do not chomp non-blank EOL

 lib/PublicInbox/Filter/Vger.pm   |  2 +-
 lib/PublicInbox/InboxWritable.pm | 44 +++++++-------------------------
 lib/PublicInbox/MboxReader.pm    |  2 +-
 t/mbox_reader.t                  | 22 +++++++++++++++-
 4 files changed, 32 insertions(+), 38 deletions(-)


^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-02-12  7:05  6% [PATCH 0/3] MboxReader usage and changes Eric Wong
2021-02-12  7:05  7% ` [PATCH 1/3] filter/vger: kill trailing newlines aggressively 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).