diff options
author | Eric Wong <e@80x24.org> | 2021-05-23 01:38:27 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-05-23 19:35:06 +0000 |
commit | ec6d2dc31406378f77aa681017083fe8e98b4df9 (patch) | |
tree | cd28d18444ce44b438609bb305d8e4e3886fea61 /lib/PublicInbox/LeiToMail.pm | |
parent | 22a88de70a33ab34b6dc52d8bf5fb8b4fa3ee66f (diff) | |
download | public-inbox-ec6d2dc31406378f77aa681017083fe8e98b4df9.tar.gz |
We support writing to IMAP stores in other places (just like Maildir), and it's actually less complex for us to write to IMAP. Neither usability nor performance is ideal, but usability will be addressed in the next commit to relax CLI argument checking. Performance is poor due to the synchronous Mail::IMAPClient API and will need to be addressed with pipelining sometime further in the future.
Diffstat (limited to 'lib/PublicInbox/LeiToMail.pm')
-rw-r--r-- | lib/PublicInbox/LeiToMail.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm index b9d4c856..f3c03969 100644 --- a/lib/PublicInbox/LeiToMail.pm +++ b/lib/PublicInbox/LeiToMail.pm @@ -307,11 +307,12 @@ sub _imap_write_cb ($$) { my $dedupe = $lei->{dedupe}; $dedupe->prepare_dedupe if $dedupe; my $append = $lei->{net}->can('imap_append'); - my $mic = $lei->{net}->mic_get($self->{uri}); - my $folder = $self->{uri}->mailbox; + my $uri = $self->{uri}; + my $mic = $lei->{net}->mic_get($uri); + my $folder = $uri->mailbox; + $uri->uidvalidity($mic->uidvalidity($folder)); my $lse = $lei->{lse}; # may be undef my $sto = $lei->{opt}->{'mail-sync'} ? $lei->{sto} : undef; - my $out = $lei->{ovv}->{dst}; sub { # for git_to_mail my ($bref, $smsg, $eml) = @_; $mic // return $lei->fail; # mic may be undef-ed in last run @@ -327,7 +328,7 @@ sub _imap_write_cb ($$) { # imap_append returns UID if IMAP server has UIDPLUS extension ($sto && $uid =~ /\A[0-9]+\z/) and $sto->ipc_do('set_sync_info', - $smsg->{blob}, $out, $uid + 0); + $smsg->{blob}, $$uri, $uid + 0); ++$lei->{-nr_write}; } } |