* [PATCH 2/2] lei_mail_sync: reject IMAP URLs w/o UIDVALIDITY
2021-05-23 21:36 6% [PATCH 0/2] lei IMAP usability stuff Eric Wong
@ 2021-05-23 21:36 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-05-23 21:36 UTC (permalink / raw)
To: meta
It's inappropriate to store sync information without
UIDVALIDITY, so add an assertion to prevent it.
---
lib/PublicInbox/LeiMailSync.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/PublicInbox/LeiMailSync.pm b/lib/PublicInbox/LeiMailSync.pm
index b2986686..63076fa1 100644
--- a/lib/PublicInbox/LeiMailSync.pm
+++ b/lib/PublicInbox/LeiMailSync.pm
@@ -7,6 +7,7 @@ use strict;
use v5.10.1;
use DBI;
use PublicInbox::ContentHash qw(git_sha);
+use Carp ();
sub dbh_new {
my ($self, $rw) = @_;
@@ -88,6 +89,10 @@ UPDATE folders SET loc = ? WHERE fid = ?
EOM
return $fid;
}
+ } elsif ($rw && $folder =~ m!\Aimaps?://!i) {
+ require PublicInbox::URIimap;
+ PublicInbox::URIimap->new($folder)->uidvalidity //
+ Carp::croak("BUG: $folder has no UIDVALIDITY");
}
return unless $rw;
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] lei IMAP usability stuff
@ 2021-05-23 21:36 6% Eric Wong
2021-05-23 21:36 7% ` [PATCH 2/2] lei_mail_sync: reject IMAP URLs w/o UIDVALIDITY Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-05-23 21:36 UTC (permalink / raw)
To: meta
Slowly making IMAP usability less bad.
Eric Wong (2):
lei inspect: use LeiMailSync->match_imap_url
lei_mail_sync: reject IMAP URLs w/o UIDVALIDITY
lib/PublicInbox/LeiExportKw.pm | 43 ++++++----------------------------
lib/PublicInbox/LeiInspect.pm | 13 +---------
lib/PublicInbox/LeiMailSync.pm | 37 +++++++++++++++++++++++++++++
t/lei-import-imap.t | 10 ++++++--
4 files changed, 53 insertions(+), 50 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 --
2021-05-23 21:36 6% [PATCH 0/2] lei IMAP usability stuff Eric Wong
2021-05-23 21:36 7% ` [PATCH 2/2] lei_mail_sync: reject IMAP URLs w/o UIDVALIDITY 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).