Mehdi Abaakouk [Tue, 8 Jan 2019 14:56:53 +0000 (15:56 +0100)]
Don't override ndata with temporary context
postponed/sendlib code can reopen an already opened mailbox.
This overrides m->ndata with a temporary context but never revert it back to
the previous one.
At first glance, when postponed/sendlib code open the mailbox they don't care
to have their context updated with the notification system. It should be
the Context used for the UI that should be updated instead.
So until we don't open a mailbox twice anymore, just set ndata when it
looks accurate to workaround the issue.
Pietro Cerutti [Tue, 8 Jan 2019 10:22:31 +0000 (10:22 +0000)]
Sort by UID so sequence ranges in UID STORE make sense
This fixes the use case where a bunch of messages are tagged, removed,
then the mailbox is sync'd in a thread view. In this case, the sequence
number given by email->index is not monotonic, which results in weird
sequence sets being passed to UID STORE.
Richard Russon [Mon, 7 Jan 2019 15:10:46 +0000 (15:10 +0000)]
merge: upstream changes
* Factor out rfc2047_decode_envelope()
* Parse and store mime headers in the BODY
* Add mx operation save_to_header_cache
* Add protected header received email support
* Add rfc2047_encode_envelope helper
* Refactor save_fcc() function
* Move fcc after send
* Prompt when mutt_write_fcc() fails
* Refactor postpone_message()
* When postponing, encode descriptions before encrypting
* More postpone cleanup
* Fix flags if mutt_get_postponed() has no messages
* Display mail sent message after Fcc finishes
* Handle improperly encoded pgp/mime octetstream part
* Add config and data structure for protected header write support
* Add a new mode for mutt_write_rfc822_header()
* Finish protected header write support
* Read in protected headers when resuming a postponed message
* Free pgpkeylist if the send fails
* Rfc2047 encode and fold X-Label when writing updates
* Restore the xlabel_changed reset
* Make a copy of x_label before encoding it for updates
* spelling consistency
* Updated French translation
* Added support for the "light" color prefix (in addition to "bright")
* Light colors: do not do the + 8 on negative values, such as COLOR_DEFAULT
* Create envelope->changed to mark all field changes
* Change x-label editing flag to be in the envelope
* Add $crypt_protected_headers_save
* Color protected subject as a header in the pager
* Respect ignore for the protected subject display
* fix config order
* Remove unused MUTT_FORMAT_MAKEPRINT flag
* Sleep $sleep_time after displaying "mail sent" message
* Update copyright for the next stable release
Kevin McCarthy [Thu, 27 Dec 2018 20:05:43 +0000 (12:05 -0800)]
Add $crypt_protected_headers_save
Setting this option will save the protected header back into the
clear-text message headers. This improves
usability (searching/limiting/replying) when reopening a mailbox
without header cache. However, it is a security trade-off, so
defaults off and strongly warns about what it is doing in the documentation.
Kevin McCarthy [Wed, 26 Dec 2018 03:52:53 +0000 (19:52 -0800)]
Change x-label editing flag to be in the envelope
Handle like In-Reply-To and References editing. Change the flag
setting to be inside mutt_copy_header().
The resetting of the changed flag occurs explicitly in the imap and
maildir/mh sync_mailbox code. It occurs for mbox in the
mx_update_tables() call in mx_sync_mailbox().
Kevin McCarthy [Wed, 26 Dec 2018 03:24:08 +0000 (19:24 -0800)]
Create envelope->changed to mark all field changes
In subsequent commits, we're going to add the x-label and subject
headers changed flags into the envelope. To avoid the list of checks
exploding everywhere, just use a single field to check and reset those
values.
Several places in the code are checking for a null header->env. I
wasn't aware this was possible, so I've added todo notes to track down
when this occurs.
Vincent Lefevre [Sat, 29 Dec 2018 18:37:57 +0000 (19:37 +0100)]
Added support for the "light" color prefix (in addition to "bright")
At the same time, restrict the advance by 8 to colors in the range 0-7
and no longer use the blink attribute to emulate light background colors
in some terminals (e.g. linux console and rxvt), as this is really blink
in other terminals (e.g. xterm); light background colors can still be
obtained by choosing a proper $TERM value (tested with linux console,
using TERM=linux-16color, and rxvt).
Kevin McCarthy [Fri, 28 Dec 2018 23:43:51 +0000 (15:43 -0800)]
Make a copy of x_label before encoding it for updates
This isn't actually a bug. Context->label_hash strdups the keys, so
we are safe from dangling references. However, the subj_hash uses
direct references, so to keep things consistent and safe, make a copy
and encode that.
Kevin McCarthy [Fri, 28 Dec 2018 00:24:27 +0000 (16:24 -0800)]
Restore the xlabel_changed reset
The cherry pick accidentally obliterated the reset. That flag is now
located in hdr->env->changed in the branch and is reset properly
elsewhere. Keep it in place in the stable branch.
Kevin McCarthy [Fri, 21 Dec 2018 18:13:17 +0000 (10:13 -0800)]
Handle improperly encoded pgp/mime octetstream part
Some clients (or even mail servers) improperly encode the octetstream
part.
Thanks to Riccardo Schirone for the original merge request patch.
This commit also handles the attachment menu, and makes the decoding
conditional so it's not done if it isn't necessary.
Kevin McCarthy [Fri, 21 Dec 2018 17:42:26 +0000 (09:42 -0800)]
Display mail sent message after Fcc finishes
For the case of IMAP, the uploading message would otherwise stay on
the screen. In any case, it's best to show that message as the last
thing before returning to the index.
Kevin McCarthy [Thu, 20 Dec 2018 01:43:26 +0000 (17:43 -0800)]
When postponing, encode descriptions before encrypting
This matches the behavior of the normal send process. I don't think
there is actually an issue here since nothing is sent, but it makes
sense to be consistent.
Austin Ray [Fri, 4 Jan 2019 02:20:21 +0000 (21:20 -0500)]
folder-hook: try matching on description
Use the description, in addition to the path, when determining to
execute a `folder-hook`. Since `named-mailboxes` and `virtual-mailboxes`
use descriptions to hide ugliness of raw paths, the description may
differ from the path and/or contain information not included in the
path.
The inclusion of description checking makes `folder-hook`s improves its
ergonomics. `notmuch` users were particularly affect by poor
`folder-hook` ergonomics since `virtual-mailboxes` paths often had large
overlap, making it hard to craft a good regex. A workaround was to add a
unique dummy key.
These are needed for the new summary tables feature
(and inspired by the Command lookup table in init.c)
added: ICommand wrapper / lookup table allowing easy addition of new
informational commands that will not be parsed in .muttrc files and
override any existing rc-line commands when executed in mutt.
added: hook in mutt_enter_command in command.c to integrate new
ICommands facility
Karel Zak [Thu, 3 Jan 2019 10:51:49 +0000 (11:51 +0100)]
notmuch: make sure nm_db_longrun_done() release DB
Since commit 1cdfc0da08e09b1756a7b4d422996e907c4390d0 the function
nm_db_release() does not release DB if long-run state is enabled.
This change make code more readable and shorter.
Unfortunately, nm_db_release() is called from nm_db_longrun_done(), so
after the change the function nm_db_longrun_done() is no-op and long
transaction never finish. It means:
- changes are not committed the database
- after mutt restart old state (tags) is read from DB
- mismatch between notmuch tags and maildir filenames
This commit disables long-run state in nm_db_longrun_done() before
nm_db_release() is called.
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.