somini [Sun, 1 Jan 2017 12:37:54 +0000 (12:37 +0000)]
Allow custom status flags in index_format
The commit introduces the variable $flag_chars.
It allows the user to customise the status flags show in the index.
$flag_chars affects both %S and %Z.
$flag_chars defaults to "*!DdrONon- "
Char | Default | Description
------|---------|----------------------------------------------
1 | * | The mail is tagged
2 | ! | The mail is flagged as important
3 | D | The mail is marked for deletion
4 | d | The mail has attachments marked for deletion
5 | r | The mail has been replied to
6 | O | The mail is Old (Unread but seen)
7 | N | The mail is New (Unread but not seen)
8 | o | The mail thread is Old (Unread but seen)
9 | n | The mail thread is New (Unread but not seen)
10 | - | The mail is read - %S expando
11 | <space> | The mail is read - %Z expando
When searching over a very large result, the result will be very slow for mutt
to load. So, inspired by sup's feature to iteratively load the results, I figured
adding a couple of commands to move an user set window backward/forward in time
could be useful. And a new command extending the default vfolder-from-query function
is being exposed.
The current window information is user settable, so the user can make a macro that
would do useful stuff about a search (like moving the window's position around, or
further tweaking current search).
* addition of four configuration variables, the first two are aimed at configuring
the behaviour of the feature, the last two are exposing internals to make it
hacking friendly:
- nm_query_window_duration: duration for each window
- nm_query_window_timebase: time base for each window
- nm_query_window_current_search: the search being displayed as vfolder
- nm_query_window_current_position: the current window's position
* addition of three bindable commands:
- windowed-vfolder-from-query: execute a search with a window applied
- windowed-vfolder-backward: move the window backwards in time
- windowed-vfolder-forward: move the window forwards in time
Richard Russon [Tue, 20 Dec 2016 15:15:39 +0000 (15:15 +0000)]
fix: rework initials to allow unicode characters
Take a name, e.g. "John F. Kennedy" and reduce it to initials "JFK".
The function saves the first character from each word. Words are
delimited by whitespace, or hyphens (so "Jean-Pierre" becomes "JP").
Adam Borowski [Wed, 21 Dec 2016 22:10:02 +0000 (23:10 +0100)]
manually touch 'atime' when reading a mbox file
futimens is a new thing, coming from POSIX-2008, yet all modern Unices added
it almost immediately. If it isn't implemented, silently ignoring that is
no worse than current state.
While performance issues related to atime updates have been greatly reduced
by relatime and lazytime, it is an abomination for other reasons: CoW
filesystems (btrfs, zfs, ...), CoWed VM images, deduplicating thin
provisioning, etc lose significant space for every snapshot. It also causes
wear on flash-based storage prevalent on SoCs, and so on. Thus, it is
prudent to mount everything with noatime.
There is only one real use for atime these days: new mail notification on
mbox files. With only a limited number of readers (mutt is one), let's
do atime updates manually.
This can be done unconditionally: while redundant without noatime, there's
no performance loss as the inode will be dirty already in such case.
Richard Russon [Sat, 31 Dec 2016 16:45:35 +0000 (16:45 +0000)]
merge: upstream fixes (mutt/default)
* search muttrc file according to XDG Base Specification (closes #3207)
* Fix loop terminator in in mutt_find_cfg().
* Backout inlining of MUTT_VERSION in 42fee7585fae.
* Revert changes made to mutt_find_cfg() in 3c6d322912e3
* Improve openssl interactive_check_cert. (closes #3899)
* Add mutt_array_size macro, change interactive_check_cert() to use it. (see #3899)
* Return to pager upon aborting a jump operation. (closes #3901)
* Change sidebar_spoolfile coloring to be lower precedence.
* automatic post-release commit for mutt-1.7.2
* Move '@' pattern modifier documentation to the right section.
* Add setenv/unsetenv commands.
* Rework OpenSSL certificate verification to support alternative chains. (closes #3903)
* Remove unused OPS
* Add option to control whether threads uncollapse when new mail arrives.
* In the manual, replaced 2 para by example (similar to the first example).
* Create mbchar_table type for multibyte character arrays. (see #3024)
* Make to_chars and status_chars accept mulitibyte characters. (closes #3024)
* sync xdg config file handling
* sync Fromchars to upstream version
Michał Kępień [Tue, 13 Dec 2016 19:16:10 +0000 (11:16 -0800)]
Rework OpenSSL certificate verification to support alternative chains. (closes #3903)
The way Mutt currently verifies SSL certificates using OpenSSL does
not support alternative chains, which may cause confusion when some
popular mail providers (e.g. Gmail) are used with specific sets of
trusted CA certificates.
Replace the "manual" verification done by mutt in
check_certificate_by_signer() with SSL_set_verify() using a callback.
OpenSSL then does the certificate verification, including properly
looking at alternative chains. The callback still provides the
opportunity to override using ~/.mutt_certificates or an interactive
prompt.
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.