* [PATCH 1/4] learn: fix redundant ham import on dual matches
2023-11-11 9:04 6% [PATCH 0/4] support publicinboxImport.dropUniqueUnsubscribe Eric Wong
@ 2023-11-11 9:04 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2023-11-11 9:04 UTC (permalink / raw)
To: meta
When learning and injecting new messages ham, we want to avoid
wasting cycles importing the same message into an inbox twice
(once for the To/Cc match and once for the List-Id match). Our
existing %seen hash turned out to be ineffective since
PublicInbox::Inbox refs get re-blessed to PublicInbox::InboxWritable.
So we stop letting class name influence the hash key for tracking by
using the reference address instead. We can get the reference address
by performing an arithmetic operation (+ 0) instead of having to
pay the cost of importing Scalar::Util::refaddr.
---
script/public-inbox-learn | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/script/public-inbox-learn b/script/public-inbox-learn
index 54d31cb6..8069d919 100755
--- a/script/public-inbox-learn
+++ b/script/public-inbox-learn
@@ -110,12 +110,12 @@ if ($train eq 'spam' || ($train eq 'rm' && $opt{all})) {
my %seen;
while (my ($addr, $ibx) = each %dests) {
next unless ref($ibx); # $ibx may be 0
- next if $seen{"$ibx"}++;
+ next if $seen{0 + $ibx}++;
remove_or_add($ibx, $train, $mime, $addr);
}
my $dests = PublicInbox::MDA->inboxes_for_list_id($pi_cfg, $mime);
for my $ibx (@$dests) {
- next if $seen{"$ibx"}++;
+ next if $seen{0 + $ibx}++;
remove_or_add($ibx, $train, $mime, $ibx->{-primary_address});
}
}
^ permalink raw reply related [relevance 7%]
* [PATCH 0/4] support publicinboxImport.dropUniqueUnsubscribe
@ 2023-11-11 9:04 6% Eric Wong
2023-11-11 9:04 7% ` [PATCH 1/4] learn: fix redundant ham import on dual matches Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2023-11-11 9:04 UTC (permalink / raw)
To: meta
Patch 2 is the important one in this series to drop unique
tokens from public archives.
I noticed our unsubscribe.milter example was adopted on one of
the lists I'm subscribed to, and didn't want my independent
public archive of that list to get sabotaged by somebody else
unsubscribing me via HTTPS.
Oddly, the rest of the unsubscription process via
unsubscribe.psgi (HTTPS) or mailto: didn't seem configured by
that list I'm subscribed to. IOW, they're only running
unsubscribe.milter so far and generating List-Unsubscribe
headers which don't work...
1, 3 and 4 fix some small things I noticed while working on 2.
Eric Wong (4):
learn: fix redundant ham import on dual matches
mda|learn|watch: support dropUniqueUnsubscribe config
mda: fix and test some usage problems
doc: update README.unsubscribe
Documentation/public-inbox-config.pod | 17 ++++++++
Documentation/public-inbox-learn.pod | 19 +++++++++
Documentation/public-inbox-mda.pod | 18 +++++++-
Documentation/public-inbox-watch.pod | 6 ++-
examples/README.unsubscribe | 9 ++--
lib/PublicInbox/Import.pm | 27 ++++++++++++
lib/PublicInbox/LeiToMail.pm | 6 +++
lib/PublicInbox/Watch.pm | 1 +
script/public-inbox-learn | 7 +++-
script/public-inbox-mda | 11 ++++-
script/public-inbox-watch | 2 +
t/lei-import.t | 48 +++++++++++++++++++++-
t/mda.t | 59 +++++++++++++++++++++++++--
t/watch_maildir.t | 30 ++++++++++++--
14 files changed, 242 insertions(+), 18 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 --
2023-11-11 9:04 6% [PATCH 0/4] support publicinboxImport.dropUniqueUnsubscribe Eric Wong
2023-11-11 9:04 7% ` [PATCH 1/4] learn: fix redundant ham import on dual matches 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).