Richard Russon [Sun, 9 Sep 2018 15:20:11 +0000 (16:20 +0100)]
merge: redistribute Context and Mailbox
* fix mxapi comments
* move Context.mx_ops
* move Context.ctx->data
* move Context.{hdrs,hdrmax}
* move Context.{size,changed,readonly,quiet,closing}
* free_data
* notmuch: move mailbox data
* notmuch: let mxapi do cleanup
* notmuch: use mailbox, not context
* mbox: use Mailbox, not Context
* maildir: use Mailbox, not Context
* nntp: use Mailbox, not Context
* pop: use Mailbox, not Context
* compress: use Mailbox, not Context
* imap: use Mailbox, not Context
* add mbox private Mailbox data
* move Context.rights
* eliminate Context from backends
* Mailbox doesn't begin with 'b'
* move Context.compress
* tidy compress
* move Context.{id,subj,label}_hash
* move Context.{v2r,vcount}
* move Context.mtime
* tidy context usage
* imap: rename mailbox out of the way
Richard Russon [Mon, 3 Sep 2018 23:53:24 +0000 (00:53 +0100)]
merge: upstream CONDSTORE and QRESYNC
* Add basic CONDSTORE support when fetching initial messages.
* Add utility functions for QRESYNC support.
* Add QRESYNC support.
* Add more doc for the $imap_condstore and $imap_qresync options.
* Only sync CONDSTORE and QRESYNC on the initial download.
* Allow ctrl-c to interrupt initial IMAP header download.
* Fix nested macro warning.
* tidy upstream changes
Kevin McCarthy [Tue, 21 Aug 2018 22:51:09 +0000 (15:51 -0700)]
Fix nested macro warning.
Pull the #if/#else outside of the snprintf in imap.c. On some
platforms, snprintf is a macro itself, which leads to a warning about
undefined behavior.
Thanks to Charles Diza for pointing out the problem.
Kevin McCarthy [Wed, 15 Aug 2018 23:13:45 +0000 (16:13 -0700)]
Allow ctrl-c to interrupt initial IMAP header download.
Once the mailbox is open, it is significantly more complicated to
abort and keep Mutt from crashing. But during the initial
open/download Mutt is prepared to close the mailbox cleanly on
failure.
Kevin McCarthy [Mon, 13 Aug 2018 16:43:55 +0000 (09:43 -0700)]
Only sync CONDSTORE and QRESYNC on the initial download.
In the midst of the imap_read_headers() refactor, I forgot to put this
guard on the /MODSEQ and /UIDSEQSET storage.
Because we don't deal with flag sync issues while the mailbox is open,
or when it closes, we only want to write those values to the header
cache during the initial download.
It makes no sense to perform all the header cache work if new messages
come into an open empty mailbox, so add a parameter to flag the
initial download, rather than check for msn_begin==1.
Kevin McCarthy [Sat, 26 May 2018 23:02:04 +0000 (16:02 -0700)]
Add QRESYNC support.
Refactor imap_read_headers() to break into functions for the different
queries.
Move uid_hash population to the same place msn_index is populated.
Change the VANISHED handler to not decrement MSNs for EARLIER.
FastMail, at least, does assume there are no gaps, and really it makes
no sense for there to be. Further testing will be needed.
Kevin McCarthy [Tue, 15 May 2018 01:12:39 +0000 (18:12 -0700)]
Add basic CONDSTORE support when fetching initial messages.
Store MODSEQ in the header cache, and use that to perform a "FETCH
CHANGEDSINCE" for header updates when initially downloading messages.
Further improvements could be made to add support when syncing.
Handling MODSEQ for FLAG updates while the mailbox is open would be
complicated by the fact that Mutt supports locally modified headers,
so we couldn't accept the new (or subsequent) MODSEQ.
However, this initial step may at least provide some benefit when
opening the mailbox, which is generally the most time and data
intensive.
Richard Russon [Mon, 3 Sep 2018 15:35:14 +0000 (16:35 +0100)]
merge: upstream OAUTHBEARER
* Initial support for OAUTHBEARER for IMAP.
* Support for using OAUTHBEARER for smtp.
* Remove uninitialized warning for mutt_get_stat_timespec().
* Improve OAUTHBEARER support.
* tidy upstream changes
* reorganise smtp auth_plain