Austin Ray [Tue, 1 Jan 2019 20:59:48 +0000 (15:59 -0500)]
Index: try description when changing mailboxes
Mailbox: find mailbox by description
Introduce `mutt_find_mailbox_desc()`, which takes a pointer to a
description, and tries to find a mailbox that corresponds to it.
With the introduction of `named-mailboxes` and removal of
`virtual-mailboxes` special cases, users may prefer to operate with
descriptions instead of (potentially) ugly paths. We can no longer
assume that a buffer is a path and require a method to find by
description.
This is not included as an `mxapi` function since `desc` is common to
all mailboxes so the backends do not need implement their own function.
Index: try description when changing mailboxes
Since mailbox descriptions are more prevalent with `named-mailboxes` and
`virtual-mailbox` special cases being removed, some users will try to
change folders with a description instead of a path.
This commit modifies `main_change_folder()` to look for a mailbox with a
given description if path probing fails.
Richard Russon [Wed, 2 Jan 2019 13:23:22 +0000 (13:23 +0000)]
demote 'last message' errors to messages
These error messages were annoying:
- You are on the last message
- You are on the first message
- Top of message is shown
- Bottom of message is shown
color: call use_default_colors() in a single location
we call use_default_colors() when parsing colors in rc files only, and
unconditionally when defining the color of the tree element, because the
foreground color of the tree element may be combined dynamically with
the default background color of another element, not explicitely defined
in an rc file. This patch fixes a bug visible with some versions of the
ncurses library: use_default_colors() was used too late, and generated
color leakage effects. (#689)
-> colors look fine on Fedora 28 with ncurses backend. The comment about slang
was in there since the first submission to git in early 2017.
valgrind backtrace of the issue without the patch:
==223072== Use of uninitialised value of size 8
==223072== at 0x593E823: tolower (in /usr/lib64/libc-2.27.so)
==223072== by 0x4C32BC5: strcasecmp (vg_replace_strmem.c:693)
==223072== by 0x43FFEB: mutt_parse_unmailboxes (mailbox.c:500)
==223072== by 0x43B134: mutt_parse_rc_line.part.18 (init.c:3145)
==223072== by 0x43B42B: mutt_parse_rc_line (init.c:3120)
==223072== by 0x43B42B: source_rc (init.c:823)
==223072== by 0x43B93A: parse_source (init.c:1845)
==223072== by 0x43B134: mutt_parse_rc_line.part.18 (init.c:3145)
==223072== by 0x43B42B: mutt_parse_rc_line (init.c:3120)
==223072== by 0x43B42B: source_rc (init.c:823)
==223072== by 0x43C1B2: mutt_init (init.c:3045)
==223072== by 0x406EB0: main (main.c:688)
The same problem is also present in the official neomutt 2018-07-16,
I've forward-ported and tested the fix for git HEAD.
The code was slightly refactored to be more readable.
Mark Stenglein [Tue, 1 Jan 2019 00:57:37 +0000 (19:57 -0500)]
imap: command: Adds unique sequence IDs
This patch adds support for unique sequence IDs to be logged. Each
new imap account is assigned an ID letter (seqid) which increments
to the next letter (and wraps at 'z') each time a new imap account
is created.
Richard Russon [Wed, 12 Dec 2018 15:22:27 +0000 (15:22 +0000)]
merge: refactor GroupContext to GroupList
* Convert GroupContext to use STAILQ
* Rename Group-related structures
* Move group.[ch] to mutt/
* Sort functions prototypes
* Get rid of global variable
* Explicitly allocate/free Groups memory
* Simplify the API when we cannot fail
* Tidy API: s/group_context/grouplist/
Richard Russon [Wed, 12 Dec 2018 12:52:48 +0000 (12:52 +0000)]
merge: imap refactoring
* imap_expunge_mailbox use m instead of adata->mailbox
* move some functions Mailbox
* imap_fix/cache_path don't need ImapAccountData
* use Mailbox in imap_sync_message_for_copy()
* Change more functions with Mailbox
Richard Russon [Mon, 10 Dec 2018 14:05:49 +0000 (14:05 +0000)]
merge: upstream fixes
* Prevent trying to match a failing color body regex repeatedly
* Fix QRESYNC crash after a large number of VANISHED messages
* Improve pgp error message for translation
* Add SENDER to default list of IMAP headers
* Document Sender header as a default in $imap_headers
* Deprecate TLS 1.0 and 1.1 by default
* Enhance docs re security of SSL/TLS version vars
* Fix compilation without deprecated OpenSSL 1.1 APIs
* Add mutt_buffer_addstr_n()
* Adjust version number comment in gpgme
* Fix classic gpg date parsing in list-keys
* Add note about the second --with-fingerprint to gpg.rc
Kevin McCarthy [Fri, 7 Dec 2018 03:22:59 +0000 (19:22 -0800)]
Fix classic gpg date parsing in list-keys
GnuPG changed the format of their --with-colons output in 2.0.10.
Dates are now seconds since epoch. Update the parse_pub_line() code
to detect the new format.
The GnuPG changes also separated pub and the first uid. Since mutt
allows an empty uid field, the output is a bit less friendly now, with
an initial key without an uid. I think that's acceptable, but
eventually we'll want to change the parsing behavior.
Kevin McCarthy [Thu, 29 Nov 2018 20:36:08 +0000 (12:36 -0800)]
Add SENDER to default list of IMAP headers
This header is matched by the ~e and ~L patterns. Those patterns
should work without the user having to know to add Sender to the list
of $imap_headers. This was probably just an oversight.
Kevin McCarthy [Tue, 27 Nov 2018 21:55:04 +0000 (13:55 -0800)]
Fix QRESYNC crash after a large number of VANISHED messages
When handling QRESYNC vanished, imap_expunge_mailbox() was called to
empty out the messages. Various counters, including vcount are
updated by the mx_update_tables() after the expunge.
These counters need to be reset, because mx_update_context() will do
so once again at the end of reading new headers. This can cause an
out of bounds access in v2r.
Kevin McCarthy [Mon, 26 Nov 2018 03:48:49 +0000 (19:48 -0800)]
Prevent trying to match a failing color body regex repeatedly
Emails with really long lines (e.g. spam), can suffer performance if a
complicated regex is matched to no effect over and over. If the regex
failed at the beginning, it won't match at the end of another's regex
match range, so turn it off.
Jenya Sovetkin [Fri, 7 Dec 2018 17:54:04 +0000 (18:54 +0100)]
reset notmuch Mailbox->size on opening
previous behaviour: size was not reset. This resulted in mailbox size to
accumulate on each mailbox reopening, hence displaying incorrect mailbox
size information in the status bar.
new behaviour: size is reset to zero.
steps to replicate previous behaviour: open neomutt with vfolder. Press
space to refresh vfolder (open from sidebar) several times. Mailbox size
in the status bar accumulates.
Pietro Cerutti [Thu, 6 Dec 2018 11:55:43 +0000 (11:55 +0000)]
merge: upstream GPGME improvements
* Require GPGME version 1.2.0 and drop useless HAVE macros.
* Always use the gpgme_new wrapper in crypt-gpgme.
* Try to avoid creation of temp. directory for key import.
* Improve the console output for extract-keys and speed up import.
The latter commit also introduced a bug in the import code which
listed all keys in the keyring to a temporary file and copied that one
to stdout. The former commit avoided the output to stdout.
The fix here is to use pgp_gpgme_extract_keys only for extracting
information about the key and don't re-use the same code for importing
keys. We now import the keys directly in pgp_gpgme_invoke_import and
we print the fingerprint and status flags for all imported keys. That
information available from GPGME for ages (0.3.1 from 2003).
The user id is unfortunately not printed; that would require a lookup
of the newly imported key. Can be done with another patch.
Werner Koch [Mon, 3 Dec 2018 07:41:55 +0000 (08:41 +0100)]
Try to avoid creation of temp. directory for key import.
Since gpgme 1.9.0 it is possible to list keys directly from a file
without importing it into gpg' own keyring. This patch implements
this in a backward compatible way.
Unfortunately we need to check for a suitable gpgme version at build
time and also for a suitable gpg version at runtime. This is
implemented by a version check which requires to call or include code
taken from libgpg-error (aka gpgrt). However this library is anyway a
dependency of gpgme and thus does not pose any extra burden.
The functions parse_version_number, parse_version_string, and
cmp_version_strings are taken from libgpg-error's repo at 2018-11-20.
Libgpg-error is distributed under the LGPL-2.1-or-later.
Werner Koch [Mon, 3 Dec 2018 07:41:54 +0000 (08:41 +0100)]
Always use the gpgme_new wrapper in crypt-gpgme.
The wrapper is much more convenient and there is no need to sometimes
use gpgme_new directly. The perceived advantage on not bailing out in
an out-of-core condition is not realistic because other small amounts
of memory are allocated all over mutt anyway and thus function will
terminate the process as well.
This patch also changes the minimum version of gpgme to 1.4.0. This
is so that we can always pass NULL to functions like gpgme_release.
Further 1.4.0 has new functions which we may soon like to use.
Werner Koch [Mon, 3 Dec 2018 07:41:53 +0000 (08:41 +0100)]
Require GPGME version 1.2.0 and drop useless HAVE macros.
GPGME 1.2.0 was released nearly 10 years ago and thus we can really
demand this version. For various reasons it would be advisable to
require a decent version but that is a different thing and needs to be
done in a separate patch.
HAVE_GPGME_OP_EXPORT_KEYS and HAVE_GPGME_PKA_TRUST are not anymore
needed because they are supported by that GPGME version.