From d98abf13946beaf685804e4ec2d79019129415b9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 3 May 2021 20:57:31 +0000 Subject: lei up: fix dedupe with remote externals on Maildir + IMAP LeiToMail Maildir and IMAP write callbacks need to account for the caller-supplied smsg. We'll also make better use of the user-supplied smsg object by ensuring blob deduplication happens ASAP. Fixes: e76683309ca4f254 ("lei : distinguish between mset and l2m counts") --- lib/PublicInbox/LeiToMail.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/LeiToMail.pm') diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm index 71acf952..64061788 100644 --- a/lib/PublicInbox/LeiToMail.pm +++ b/lib/PublicInbox/LeiToMail.pm @@ -283,7 +283,8 @@ sub _maildir_write_cb ($$) { my ($bref, $smsg, $eml) = @_; $dst // return $lei->fail; # dst may be undef-ed in last run return if $dedupe && $dedupe->is_dup($eml // - PublicInbox::Eml->new($$bref)); + PublicInbox::Eml->new($$bref), + $smsg); $lse->xsmsg_vmd($smsg) if $lse; my $n = _buf2maildir($dst, $bref // \($eml->as_string), $smsg); $sto->ipc_do('set_sync_info', $smsg->{blob}, $out, $n) if $sto; @@ -305,7 +306,8 @@ sub _imap_write_cb ($$) { my ($bref, $smsg, $eml) = @_; $mic // return $lei->fail; # mic may be undef-ed in last run return if $dedupe && $dedupe->is_dup($eml // - PublicInbox::Eml->new($$bref)); + PublicInbox::Eml->new($$bref), + $smsg); $lse->xsmsg_vmd($smsg) if $lse; my $uid = eval { $append->($mic, $folder, $bref, $smsg, $eml) }; if (my $err = $@) { -- cgit v1.2.3-24-ge0c7