Richard Russon [Mon, 1 Oct 2018 22:34:23 +0000 (23:34 +0100)]
merge: upstream fixes
* Increase buffer sizes for some IMAP commands.
* Change imap_rename_mailbox to use a BUFFER.
* Convert pgp_invoke_list_keys and mix_send_message to use BUFFERs.
Kevin McCarthy [Fri, 28 Sep 2018 22:08:19 +0000 (15:08 -0700)]
Convert pgp_invoke_list_keys and mix_send_message to use BUFFERs.
Both repetitively perform a lot of copying back in forth, which is
much cleaner with a BUFFER.
Note that in pgp_invoke_list_keys, if there are no hints uids->data
would be NULL. However, the pgp_invoke() checks and wraps all the
format substitutions with NONULL.
Kevin McCarthy [Fri, 28 Sep 2018 00:29:16 +0000 (17:29 -0700)]
Increase buffer sizes for some IMAP commands.
Use to ensure assembled IMAP commands fit in the resultant buffer to
be imap_exec()'ed.
RFC2683 suggested a limit of 1000, but asked servers to accept up to
8000. Furthermore, RFC7162 bumped the client limit suggestion up to
8192. So I don't believe any issues will be caused by this.
Most of these are increases are just to remove theoretical truncation
warned about by the compiler; I don't believe we've had reports of
actual command truncation due to a mailbox 1024 characters long.
Kevin McCarthy [Wed, 26 Sep 2018 02:03:56 +0000 (19:03 -0700)]
Fix non-threaded $sort_aux "reverse-" sorting.
The secondary sort was looking at (Sort & SORT_REVERSE) instead
of (SortAux & SORT_REVERSE), so wasn't even performing the reverse
based on the correct flag.
Additionally, afterwards, the primary sort was improperly applying a
reverse when the secondary sort returned non-zero.
Change SORTCODE() to look at SortAux when we are inside a secondary
sort.
Change AUXSORT() to return the result if the secondary sort returns
non-zero. It is ugly to put a return inside the macro, but the check
for non-zero needs to be performed inside the AUXSORT if branch.
If the secondary sort returns 0, then the primary sort can still
compare index and apply a reverse as needed.
Richard Russon [Tue, 25 Sep 2018 13:03:59 +0000 (14:03 +0100)]
merge: upstream fixes
* Change imap_conn_find() to always return an authenticated conn.
* Free queries and alias_queries before exiting.
* Remove purpose checks in smime_keys.pl verify step.
* Send imap keepalives for interactive filters.
* Add output during smime_keys purpose flag checking.
* Increase user/pass field sizes in auth_login.
Kevin McCarthy [Tue, 18 Sep 2018 02:40:22 +0000 (19:40 -0700)]
Send imap keepalives for interactive filters.
When viewing attachments externally with a (non-copiousoutput) mailcap
entry missing %s, the command is invoked as a filter, with the
attachment piped into stdin. However, unlike a filter, the user
interacts with the command, instead of just displaying the output in
the pager.
Just as with the mutt_system() command, Mutt needs to send imap
keepalives to keep those connections from closing during the
potentially extended invocation.
Thanks to John Hawkinson for the bug report, and his suggested patch,
which this commit is based upon.
Kevin McCarthy [Fri, 14 Sep 2018 21:23:04 +0000 (14:23 -0700)]
Remove purpose checks in smime_keys.pl verify step.
The purpose checks are subsequently performed, and added as a field to
the .index. In any case, it turns out passing multiple '-purpose'
arguments isn't even correct: openssl appears to just use the last
one.
Thanks to David J. Weller-Fahy for reporting the problem, and for
including a possible patch.
Kevin McCarthy [Thu, 13 Sep 2018 01:23:00 +0000 (18:23 -0700)]
Change imap_conn_find() to always return an authenticated conn.
With the flag MUTT_IMAP_CONN_NONEW, it was already ensured the
connection would be authenticated. However, without that flag, an
error in opening the connection or authentication would still return
an idata.
The callers that didn't bother to check the state were still assuming
authenticated, because they were all subseqeuently issuing an
"authenticated state" command to the server.
Rather than add state checks to every caller, just change the function
to return NULL if the idata did not end up in an authenticated state.
Remove the now redundant state checks in imap_open_mailbox() and
imap_get_mailbox().
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