* [PATCH 0/5] no trash, glossary doc
@ 2021-03-10 13:23 7% Eric Wong
2021-03-10 13:23 6% ` [PATCH 4/5] lei import: skip trashed Maildir messages Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-03-10 13:23 UTC (permalink / raw)
To: meta
-watch on IMAP now matches Maildir behavior in skipping
trashed (deleted) and draft messages.
"lei import" now ignores (trashed|deleted) messages, as well;
but imports drafts.
The glossary is intended to help reduce confusion as more
things overlap with different terminology.
Eric Wong (5):
doc: technical/data_structures: update for EOFpipe
watch: IMAP: ignore \Deleted and \Draft messages
lei import: simplify Maildir handling
lei import: skip trashed Maildir messages
doc: start glossary for overlapping concepts
Documentation/public-inbox-glossary.pod | 95 +++++++++++++++++++++
Documentation/technical/data_structures.txt | 10 +--
Documentation/txt2pre | 1 +
MANIFEST | 1 +
Makefile.PL | 3 +-
lib/PublicInbox/LeiImport.pm | 8 +-
lib/PublicInbox/LeiStore.pm | 6 --
lib/PublicInbox/MdirReader.pm | 1 +
lib/PublicInbox/NetReader.pm | 2 +
lib/PublicInbox/Watch.pm | 26 +-----
t/lei-import-maildir.t | 7 ++
xt/net_writer-imap.t | 44 ++++++++++
12 files changed, 165 insertions(+), 39 deletions(-)
create mode 100644 Documentation/public-inbox-glossary.pod
^ permalink raw reply [relevance 7%]
* [PATCH 4/5] lei import: skip trashed Maildir messages
2021-03-10 13:23 7% [PATCH 0/5] no trash, glossary doc Eric Wong
@ 2021-03-10 13:23 6% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-03-10 13:23 UTC (permalink / raw)
To: meta
This matches IMAP behavior in NetReader in skipping \\Deleted
messages. Since lei may be used for personal, non-public mail;
Draft messages are NOT skipped by "lei import".
---
lib/PublicInbox/MdirReader.pm | 1 +
t/lei-import-maildir.t | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/lib/PublicInbox/MdirReader.pm b/lib/PublicInbox/MdirReader.pm
index 44724af1..06806e80 100644
--- a/lib/PublicInbox/MdirReader.pm
+++ b/lib/PublicInbox/MdirReader.pm
@@ -57,6 +57,7 @@ sub maildir_each_eml ($$;@) {
opendir my $dh, $pfx or return;
while (defined(my $bn = readdir($dh))) {
my $fl = maildir_basename_flags($bn) // next;
+ next if index($fl, 'T') >= 0;
my $f = $pfx.$bn;
my $eml = eml_from_path($f) or next;
my @kw = sort(map { $c2kw{$_} // () } split(//, $fl));
diff --git a/t/lei-import-maildir.t b/t/lei-import-maildir.t
index a3796491..bd89677a 100644
--- a/t/lei-import-maildir.t
+++ b/t/lei-import-maildir.t
@@ -29,5 +29,12 @@ test_lei(sub {
like($res->[0]->{'s'}, qr/use boolean/, 'got expected result');
is_deeply($res->[0]->{kw}, ['answered', 'seen'], 'keywords set');
is($res->[1], undef, 'only got one result');
+
+ symlink(abs_path('t/utf8.eml'), "$md/cur/u:2,ST") or
+ BAIL_OUT "symlink $md $!";
+ lei_ok('import', "maildir:$md", \'import Maildir w/ trashed message');
+ lei_ok(qw(q -d none m:testmessage@example.com));
+ $res = json_utf8->decode($lei_out);
+ is_deeply($res, [ undef ], 'trashed message not imported');
});
done_testing;
^ permalink raw reply related [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-03-10 13:23 7% [PATCH 0/5] no trash, glossary doc Eric Wong
2021-03-10 13:23 6% ` [PATCH 4/5] lei import: skip trashed Maildir messages 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).