Kevin McCarthy [Sat, 3 Dec 2016 23:24:32 +0000 (15:24 -0800)]
Change sidebar_spoolfile coloring to be lower precedence.
Give sidebar_new and sidebar_flagged higher precedence than
sidebar_spoolfile, so that new and flagged message colors will show up
for the spoolfile in the sidebar.
Don't use X509_NAME_oneline() with a fixed size buffer, which could
truncate the string, perhaps leaving off the CN field entirely.
Instead, work directly off the X509_NAME.
Rather than use strstr to tokenize it, call
X509_NAME_get_text_by_NID() with the nid types. Although
X509_NAME_get_text_by_NID() is "legacy", it is the most directly
useful for mutt in this simple interactive prompt.
The function was set up to include the ST and C fields in the prompt,
but the loop limit was too low. I believe this was an oversight, so
increase the loop to include those two fields.
Kevin McCarthy [Fri, 18 Nov 2016 01:54:35 +0000 (17:54 -0800)]
Revert changes made to mutt_find_cfg() in 3c6d322912e3
The usage of MUTT_VERSION in mutt_find_cfg() was fine before the
commit: it wasn't using MUTT_VERSION inlined into a string with format
string substitution.
Revert to the version of mutt_find_cfg() before that changeset.
Damien Riegel [Mon, 14 Nov 2016 02:45:35 +0000 (18:45 -0800)]
search muttrc file according to XDG Base Specification (closes #3207)
First of all, the MUTT_VERSION symbol is now concatenated (when
possible) at compile time.
Then, the logic to find the config file has been changed a bit to remove
unnecessary calls to access(), so now each possible locations for the
config file is only tested once, and it stops as soon as a valid one has
been found. So instead of:
access("/home/dkc/.muttrc-1.7.1", F_OK) = -1 ENOENT (No such file or directory)
access("/home/dkc/.muttrc", F_OK) = 0
access("/home/dkc/.muttrc", F_OK) = 0
access("/home/dkc/.muttrc", F_OK) = 0
[... Tests for Muttrc ... ]
access("/home/dkc/.muttrc", F_OK) = 0
We now have:
access("/home/dkc/.muttrc-1.7+13 (f658e517960e)", F_OK) = -1 ENOENT (No such file or directory)
access("/home/dkc/.muttrc", F_OK) = 0
It also cleans up the case where -F is passed on the command line but
points to a non-existent file by moving the error path closer to the
actual fail condition.
Finally, it adds partial support for the XDG Base Directory
Specification. mutt will now try to locate its config at:
Components:
- Date of last release
- Number of commits since release
- Git commit hash of last commit
- 'dirty' if there are uncommitted changes
- Upstream Mutt version
It's appended wherever a version string is displayed, e.g. "User-Agent:"
The version suffix (-4-bee236-dirty) is checked EVERY time you run make.
However, unlike the original version, changes will only require the
rebuilding of git-ver.c
To keep things simple for the downstream distros, there are some
limitations in place:
The NeoMutt date (20161126) and the upstream Mutt version (1.7.1) are
hard-coded into configure.ac and hence the Makefile.
The suffix will be empty if:
- git isn't present
- The source isn't in a git repo
- There aren't any "neomutt-*" tags
Darshit Shah [Thu, 1 Dec 2016 23:27:36 +0000 (00:27 +0100)]
build: New configure option --enable-everything
As of this commit, the following options are enabled:
* All 6 hcache backends
* Compressed Folder Support
* GPGME
* IMAP
* NNTP
* Notmuch
* PGP
* POP3
* SMIME
* SMTP
* Sidebar
Ian Zimmerman [Fri, 2 Dec 2016 13:14:26 +0000 (13:14 +0000)]
feature: $from_chars highlights differences in authorship
This adds a new variable $from_chars which works like $to_chars.
It will add a character prefix to the %F or %L field in $index_format.
The character is determined by the contents of the To/Cc/Bcc fields.
Pietro Cerutti [Fri, 18 Nov 2016 16:49:37 +0000 (16:49 +0000)]
build: enhance mutt_to_base64() (and callers)
- take chars and cast to unsigned chars inside, remove casts from callers
- return the number of characters written to the output buffers
- Doxygenize and verboize the documentation
Richard Russon [Sat, 26 Nov 2016 11:20:16 +0000 (11:20 +0000)]
fix: index in pager crash
The steps to reproduce this were:
- open a mail
- change the underlying maildir while the mail is open
- reply to the mail
I can't reproduce the original crash, but it happened when the index was
being redrawn. One of the "Context->hdrs" was NULL causing
index_make_entry to crash.
Richard Russon [Thu, 24 Nov 2016 20:00:59 +0000 (20:00 +0000)]
merge: upstream fixes (mutt/default)
* When $flag_safe is set, flagged messages cannot be deleted.
* Adds the '@' pattern modifier to limit matches to known aliases.
* Adds <mark-message> binding to create "hotkeys" for messages.
* Updated requirement on the C compiler.
* Updated French translation (except for 1 string).
* Make a string translatable. Add a missing space at the end.
* Make a string translatable.
* Updated French translation.
* Updated French translation.
* Fix mark-message translation and keybind menu.
* More openssl1.1 fixes: remove uses of X509->name in debugging. (closes #3870)
* Don't close stderr when opening a tunnel. (closes #3726)
* Minor resource and error logic cleanup in tunnel_socket_open()
* Make sure that the output of X509_NAME_oneline is null-terminated.
* Revert db13010a2e8d but add a comment. (see #3870)
* Corrected comment.
Kevin McCarthy [Mon, 21 Nov 2016 00:19:17 +0000 (16:19 -0800)]
Don't close stderr when opening a tunnel. (closes #3726)
Instead of closing stderr, redirect it to /dev/null in
tunnel_socket_open(). Otherwise a program can accidentally open a
file into handle 2 and then unknowingly use that when trying to print
to stderr.
Thanks to lotheac for the original patch, which I just modified
slightly.
Kevin McCarthy [Sun, 20 Nov 2016 03:35:07 +0000 (19:35 -0800)]
More openssl1.1 fixes: remove uses of X509->name in debugging. (closes #3870)
X509->name was a shortcut for the longer
name = X509_NAME_oneline (X509_get_subject_name (cert),
buf, sizeof (buf));
invocation. Change the debugging to print the cert name and chain
names in the ssl_check_certificate() loop instead.
Kevin McCarthy [Fri, 18 Nov 2016 23:54:27 +0000 (15:54 -0800)]
Fix mark-message translation and keybind menu.
Move the OP_MARK_MESSAGE and hotkey macro from MENU_GENERIC to the
MENU_MAIN keymap. Putting the macro under generic prevents it from
overriding a keybinding in the index (even if the function is bound to
noop). Additionally, the macro can only be executed from the index,
so it doesn't make sense as a generic keybinding.
Use the term "hotkey" in both the OPS and km_bind description.
Mark the km_bind description translatable.
Add L10N messages for the new translation strings.
David Champion [Thu, 17 Nov 2016 23:57:42 +0000 (15:57 -0800)]
Adds <mark-message> binding to create "hotkeys" for messages.
<mark-message>foo<enter> will create a new macro "'foo" which will
return to the current message by searching for that message's
message id. The initial character of the macro is defined by
$mark_macro_prefix, and defaults to "'" for verisimilitude vs. vi.
Serge Gebhardt [Sat, 19 Nov 2016 22:15:21 +0000 (23:15 +0100)]
$forward_references includes References: header on forwards
By default a forwarded message does not reference the messages it
contains. This commit introduces a new boolean option
`$forward_references`. When it is set, a forwarded message includes the
`In-Reply-To:` and `References:` headers, just like a reply would. Hence
the forwarded message becomes part of the original thread instead of
starting a new one.
Richard Russon [Thu, 24 Nov 2016 14:02:48 +0000 (14:02 +0000)]
merge: hcache refactor
* Support compilation of multiple hcache backends and run-time selection
* More hcache-related cleanup and consistency in autoconf land
* Hcache backends list
* Hcache backends list up tidying
* Implement mutt_hcache_free to dispose of header cache data
Pietro Cerutti [Thu, 10 Nov 2016 13:33:16 +0000 (13:33 +0000)]
Support compilation of multiple hcache backends and run-time selection
Backend specific APIs have been moved to hcache-backend.h
This commits introduces the support for multiple backends and an option to
configure the one to use at run time (header_cache_backend). Backends are not
mutual exclusive anymore, and several can be compiled in by specifying multiple
--with-<backend> configure options.
For backwards compatibility, the header_cache_backend option can be left empty,
in which case the first (configure.ac order) compiled-in backend is selected.
In the case of distros building with a single backend enabled - as they are
forced to do today - the hcache functionality is unchanged.
Richard Russon [Sat, 19 Nov 2016 01:39:44 +0000 (01:39 +0000)]
merge: upstream adoption of compress
* Compress patch from the neomutt repository.
* Compress: prefix external functions with "mutt_"
* Compress: remove buffy stats "improvisation".
* Compress: fix several logic and memory bugs.
* Compress: add delegate calls to open_append and close mx_ops functions.
* Compress: safe_fopen() the tempfile, to prevent tempfile attacks.
* Compress: pull the lock/unlock operations into the open,close,sync operations.
* Create mx_ops.sync operation. Refactor compress to use the mx_ops.sync.
* Compress: fix check_mailbox and sync_mailbox.
* Compress: escape single quotes when invoking the compress/decompress commands.
* Compress: check mailbox type if possible when appending.
* Ensure the compressed documentation is always built.
* Improve two compress translation messages.
* Revert "Compress: remove buffy stats "improvisation"."
Kevin McCarthy [Mon, 14 Nov 2016 04:02:36 +0000 (20:02 -0800)]
Compress: check mailbox type if possible when appending.
If an append hook isn't defined, then mutt has to decompress the
mailbox. In that case, we can check the type of the decompressed
mailbox instead of defaulting to DefaultMagic.