diff options
author | Eric Wong <e@80x24.org> | 2021-10-23 18:20:40 -0600 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-10-24 02:20:33 +0000 |
commit | f59ac79a64759396ce484616393cdad18d431a57 (patch) | |
tree | 397b6741fb77b9ce6250ae6b1dd78e477c928047 /lib/PublicInbox/NetWriter.pm | |
parent | cb04d2ddfd53c36eaf1a49cadb8158ae76622683 (diff) | |
download | public-inbox-f59ac79a64759396ce484616393cdad18d431a57.tar.gz |
Since we want to store IMAP flags asynchronously and not wait for results, we can't check for IMAP errors this way and end up wasting bandwidth on public-inbox-imapd. Now, we just check PERMANENTFLAGS up front to ensure a folder can handle IMAP flag storage before proceeding.
Diffstat (limited to 'lib/PublicInbox/NetWriter.pm')
-rw-r--r-- | lib/PublicInbox/NetWriter.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/PublicInbox/NetWriter.pm b/lib/PublicInbox/NetWriter.pm index 629a752a..4a1f34f6 100644 --- a/lib/PublicInbox/NetWriter.pm +++ b/lib/PublicInbox/NetWriter.pm @@ -56,4 +56,13 @@ sub imap_set_kw { $mic; # caller must ->expunge } +sub can_store_flags { + my ($self, $mic) = @_; + for ($mic->Results) { + /^\* OK \[PERMANENTFLAGS \(([^\)]*)\)\].*/ and + return $self->can('perm_fl_ok')->($1); + } + undef; +} + 1; |