Kevin McCarthy [Thu, 8 Aug 2019 01:34:58 +0000 (18:34 -0700)]
Turn off macro processing during autocrypt initialization
The muttrc can push events into the macro buffer, with the assumption
that mailbox will be opened next. This will interfere with the
prompts uses during first run. The only issue is that macros won't
work inside the folder browser, if invoked.
Kevin McCarthy [Thu, 8 Aug 2019 01:24:15 +0000 (18:24 -0700)]
Allow nested setting of OptIgnoreMacroEvents
This will be needed for the first-run of autocrypt initialization.
The initialization involves a number of prompts, and can even use the
folder browser. The browser could in turn connect to IMAP which might
invoke a certificate prompt, login prompt, etc.
Kevin McCarthy [Fri, 19 Jul 2019 19:54:32 +0000 (12:54 -0700)]
Add autocrypt line to the compose menu
Remove the hardcoded HDR_ATTACH offset calcuation, and add an explicit
enum for the "-- Attachments" line to make loops and padding array
sizes easier.
Add security and recommendataion fields on the line.
Add mutt_autocrypt_ui_recommendation, following the autocrypt spec
guidelines.
Kevin McCarthy [Fri, 12 Jul 2019 01:06:56 +0000 (18:06 -0700)]
Add autocrypt header parsing to mutt_parse_rfc822_line()
Convert parse_parameters() for autocrypt header usage:
* change to use a struct Buffer to accomodate large autocrypt keydata
attribute values.
* Autocrypt header parameters are not rfc2231 compliant. Rather
than rolling another very similar function, just change the
existing one to allow space separation.
Richard Russon [Mon, 19 Aug 2019 22:42:06 +0000 (23:42 +0100)]
test: remove mutt_str_pretty_size()
mutt_str_pretty_size() now relies on four config variables, so it's been
demoted to muttlib.c. When it's been converted to use flags instead of
config variables, it can be returned to the library.
Kevin McCarthy [Fri, 28 Jun 2019 22:09:51 +0000 (15:09 -0700)]
Add size display configuration variables
Although it would be nice to "open this up" more, performance and
security/stability issues would arise.
Based on the thread in mutt-dev, I hope these vars will satisfy most
customization needs:
$size_show_bytes
$size_show_mb
$size_show_fractions
$size_units_on_left
Scott Kostyshak [Sun, 18 Aug 2019 17:07:26 +0000 (13:07 -0400)]
Fix parsing of GnuPG output
In GnuPG output there is a space after "[GNUPG:]". If the space is
not taken into account, the rest of the parsing fails, e.g., because
the variable "line" starts with " BEGIN_DECRYPTION" instead of the
expected "BEGIN_DECRYPTION".
This commit restores the previous parsing functionality. It appears
that the number of spaces does not differ among GnuPG versions.
However, if we wanted to make the code robust to varying amount of
space following "[GNUPG:]", we could either trim the whitespace from
the beginning or take it into account with mutt_str_lws_len().
This commit fixes a regression introduced at c2aa0c06.
Austin Ray [Mon, 12 Aug 2019 21:42:47 +0000 (17:42 -0400)]
notmuch: sort headers on interrupted read
Commit 45639e4 breaks partial notmuch mailbox loads. If a notmuch mailbox is
interrupted while loading, the index will be empty. To resolve this, add back
the 'mutt_sort_headers()' for the interrupted read case.
Change OptIgnoreMacroEvents to actuallly ignore macros instead of
throwing errors.
Add a comment to the OptIgnoreMacroEvents km_dokey() change
The option was added in commit 53900afa, and its actual purpose was
to separate out an "unget" event buffer from the "macro" buffer, to
solve a problem with certificate prompts.
The safest approach in a low-level function like km_dokey() was to
return an error if new macros were generated when the option is set.
However, this results in an unbuffered username/password prompt being
aborted.
Currently the only users of unbuffered input are the SSL certificate
prompts, which use menu->dialog mode (and thus mutt_getch() directly)
and username/password prompts. So the only affected cases are
editor-menu prompts, and returning the pressed keys is likely less
surprising than aborting the prompt.
If other unbuffered menus are created in the future, we may want to
add a check for which menu mode is being used.
Austin Ray [Sat, 3 Aug 2019 20:34:32 +0000 (16:34 -0400)]
notmuch: ensure message_id is correct
The notmuch-backend initializes a provided email struct with content
from notmuch. In rare instances, a provided email struct has a
message_id that does not match the one from notmuch. No validation to
ensure message_ids match is performed.
An issue occurs when running nm_mbox_check(), which stores all messages
in a hash table. The incorrect message_id is the key so our email is
considered missing, reloaded into the mailbox, and a duplicate appears
in the index. This triggers a warning from neomutt regarding external
modification.
Instead, validate the message_ids to ensure a match so our hash table
keys are correct. As a result, a reload is no longer performed and
neomutt's warning need not occur.
Richard Russon [Sat, 20 Jul 2019 22:18:23 +0000 (23:18 +0100)]
merge: light refactoring
* test: sync mutt_extract_token()
* drop Buffer.destroy
* refactor: Mailbox in mutt_display_message()
* pager: reorganised the code
* context: tidy for clarity
* context: add notifications
* notify: use data to match specific callbacks
Richard Russon [Fri, 19 Jul 2019 21:48:51 +0000 (22:48 +0100)]
drop Buffer.destroy
This member controlled whether, when destroyed, a Buffer should delete
its data. The member was only used in a couple of places, so it seems
better to duplicate the data in those cases and *always* destroy it
afterwards.