+sub lms {
+ my ($lei, $creat) = @_;
+ my $sto = $lei->{sto} // _lei_store($lei) // return;
+ require PublicInbox::LeiMailSync;
+ my $f = "$sto->{priv_eidx}->{topdir}/mail_sync.sqlite3";
+ (-f $f || $creat) ? PublicInbox::LeiMailSync->new($f) : undef;
+}
+
+sub sto_done_request {
+ my ($lei, $wq) = @_;
+ return unless $lei->{sto};
+ local $current_lei = $lei;
+ my $sock = $wq ? $wq->{lei_sock} : undef;
+ $sock //= $lei->{sock};
+ my @io;
+ push(@io, $sock) if $sock; # async wait iff possible
+ eval { $lei->{sto}->wq_io_do('done', \@io) };
+ warn($@) if $@;
+}
+
+sub cfg_dump ($$) {
+ my ($lei, $f) = @_;
+ my $ret = eval { PublicInbox::Config->git_config_dump($f, $lei->{2}) };
+ return $ret if !$@;
+ warn($@);
+ undef;
+}
+
+sub request_umask {