about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiToMail.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-05-03 20:57:31 +0000
committerEric Wong <e@80x24.org>2021-05-04 02:35:34 +0000
commitd98abf13946beaf685804e4ec2d79019129415b9 (patch)
treece554cf307a0b56f07a1b1c95e50a000272a0254 /lib/PublicInbox/LeiToMail.pm
parente77f38470abdd0f4df8c2469c36f17188f0df64c (diff)
downloadpublic-inbox-d98abf13946beaf685804e4ec2d79019129415b9.tar.gz
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 <q|up>: distinguish between mset and l2m counts")
Diffstat (limited to 'lib/PublicInbox/LeiToMail.pm')
-rw-r--r--lib/PublicInbox/LeiToMail.pm6
1 files changed, 4 insertions, 2 deletions
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 = $@) {