Richard Russon [Mon, 10 Oct 2016 16:03:39 +0000 (17:03 +0100)]
fix updates when pager is open
This is an update to #19 - new-mail doesn't fire if pager open
Issue #19 changed NeoMutt so that it would notify the user of incoming
mail, even when they were in the pager. However, there was one case
where it didn't work -- new mail arriving in the current mailbox.
Richard Russon [Mon, 10 Oct 2016 08:51:05 +0000 (09:51 +0100)]
forgotten-attachment: fix empty regex expression
The original regex was of the form "abc(|def)" to check for both "abc"
and "abcdef". Unfortunately, the regex libraries on BSDs/MacOS don't
like this use of an empty sub-expression.
Expanding the regex to: "(abc|abcdef)" fixes the problem.
Richard Russon [Sun, 9 Oct 2016 10:39:58 +0000 (11:39 +0100)]
merge: upstream fixes (mutt/default)
* Preserve forwarded attachment names in d_filename.
* Updated Czech translation.
* Mark IMAP fast-trash'ed messages as read before copying. (see #3860)
* automatic post-release commit for mutt-1.7.1
Kevin McCarthy [Thu, 6 Oct 2016 19:35:38 +0000 (12:35 -0700)]
Mark IMAP fast-trash'ed messages as read before copying. (see #3860)
Regular copying/saving messages in mutt via a UID COPY first calls
imap_sync_message(). However that function is designed to sync all
flags (including deleted), and so isn't useful for the fast-trash
code.
As an easier solution, instead add a UID STORE to set \\Seen for the
same msgset as the trashed messages.
Kevin McCarthy [Tue, 4 Oct 2016 18:13:24 +0000 (11:13 -0700)]
Preserve forwarded attachment names in d_filename.
When forwarding an attachment with an non-ascii name, mutt_copy_body()
mangles the filename when calling mutt_adv_mktemp. Preserve
the original attachment filename in d_filename.
Remove the double copy of b->filename, which is a memory leak.
Kevin Velghe [Sun, 14 Aug 2016 22:24:20 +0000 (00:24 +0200)]
notmuch: Synchronise tags to flags
Currently, flags are synced to tags, but the reverse isn't true. If you
mark a mail as unread "the mutt way", you'll be able to find this mail
using tag:unread, however if you remove the tag unread, the flags aren't
adjusted, and it's still marked unread in mutt.
This functionality is provided by notmuch, but means that any mail has
to be synced to disc when the labels are modified, which conflicts with
the way synchronisation to disk works in mutt.
To solve this properly, it's best to just check if the changes performed
in the tags involve some flags handled by mutt, and if so, update the
header in mutt. When mutt syncs to disc, the flags will be adjusted on
disc as well.
Some remarks:
- The parsing code is currently duplicated. I'll fix this.
- The labels are currently hard-coded. It seems like notmuch doesn't
allow customisation of these labels, but mutt-kz does for unread.
- The draft and passed labels are currently ignored, as they aren't
handled by mutt.
Richard Russon [Thu, 6 Oct 2016 14:01:20 +0000 (15:01 +0100)]
fix: crash handling keywords/labels
When an email is read by NeoMutt the labels are stored in linked list of
strings. These strings are used as keys in a hash table of all labels.
If NeoMutt reads another email with the same label, it's given a
reference to the same hash.
Now imagine that the first email is deleted -- the list of labels is
also deleted, so that hash now has invalid keys.
This commit maintains a linked list of all labels and uses that for the
hash table keys. It's not very efficient, but it avoids having to
change the hash table code.
Note: dgc (the keywords author) has created a new version which will
supplant this one, soon.
Richard Russon [Sun, 2 Oct 2016 15:05:55 +0000 (16:05 +0100)]
merge: upstream fixes (mutt/default)
* Fix gpgme segfault when querying candidates with a '+' in the address. (closes #3873)
* Use body color for gpgme output. (closes #3872)
* Check for NULL mx_ops in mx.c
* Mark some gpgme pgp menu keybinding translations as fuzzy. (closes #3874)
* Don't abort the menu editor on sigwinch. (closes #3875)
* Clear pager position when toggling headers.
* Reset invalid parsed received dates to 0. (closes #3878)
* RFC2047-decode mailto header values. (closes #3879)
* RFC2047-decode mailto url headers after RFC2822 parsing. (closes #3879)
* Ensure signatures exist when verifying multipart/signed emails. (closes #3881).
Kevin McCarthy [Sat, 1 Oct 2016 23:21:59 +0000 (16:21 -0700)]
Ensure signatures exist when verifying multipart/signed emails. (closes #3881).
TAKAHASHI Tamotsu reported that when gpg2 isn't in PATH, the
gpgme_op_verify() won't return an error, but instead will return a
result with no signatures.
verify_one() was only returning an error if a signature actually
failed, so in this case the function was defaulting to returning
success.
Other callers of gpgme_op_verify() check to make sure the
result->signatures exist before processing signatures. Add a check
for verify_one() too.
Kevin McCarthy [Sat, 1 Oct 2016 20:58:35 +0000 (13:58 -0700)]
RFC2047-decode mailto url headers after RFC2822 parsing. (closes #3879)
Commit 55819a7e6169 performed the RFC2047 decode before the parsing.
This works okay for headers such as subject, but for others such as
address fields could lead to parsing errors.
Change to perform a decode on envelope headers after all the calls to
mutt_parse_rfc822_line(), using the same list of fields as
mutt_read_rfc822_header().
Change the do_2047 parameter of mutt_read_rfc822_line() to true, so
that user headers are decoded if needed.
Kevin McCarthy [Sun, 25 Sep 2016 20:11:03 +0000 (13:11 -0700)]
Reset invalid parsed received dates to 0. (closes #3878)
The actual problem in the ticket would be solved by d3f31cf9239e (see
#3798). However there is still the bug that Mutt considers a
(hdr->received != 0) to be set and usable, despite not checking the
return value of mutt_parse_date().
Change mutt_read_rfc822_header() to unset an invalid received value
back to 0. We don't do this inside mutt_read_rfc822_line() because
that would cause the next received line to be parsed.
Kevin McCarthy [Fri, 23 Sep 2016 23:07:36 +0000 (16:07 -0700)]
Clear pager position when toggling headers.
It doesn't make sense to try to preserve the pager position when
toggling headers: the purpose of toggling headers is to see the
headers in full or weeded state. So, reset the position back to the
top.
Kevin McCarthy [Thu, 22 Sep 2016 21:07:18 +0000 (14:07 -0700)]
Don't abort the menu editor on sigwinch. (closes #3875)
getch() will return ERR on sigwinch when timeout() is called with a
positive value. mutt_getch() will therefore return ch==-2 for both a
timeout and a sigwinch in this case.
The imap code in km_dokey() exits out of the ImapKeepalive loop for a
SigWinch, and was skipping past the check for MENU_EDITOR and
tmp.ch==-2. Move this check below the gotkey: label so the
ImapKeepalive loop behaves the same as the Timeout code.
Thanks to nicop for reporting the problem and for the initial patch!
Antonio Radici [Thu, 22 Sep 2016 01:10:33 +0000 (18:10 -0700)]
Mark some gpgme pgp menu keybinding translations as fuzzy. (closes #3874)
Some translations for crypt-gpgme.c are marked as fuzzy but the keybindings
attached to these translations are not, this creates confusions for the users
who see the english message but have the keybindings for a message in their own
language available.
As long as the translations are fuzzy, the keybindings should stay fuzzy.
Kevin McCarthy [Wed, 21 Sep 2016 20:51:01 +0000 (22:51 +0200)]
Check for NULL mx_ops in mx.c
Eike Rathke reported this happening when in an IMAP index view the
underlying connection was terminated, ctx->mx_ops was NULL and thus
accessing ctx->mx_ops->check segfaulted.
Thanks also to Eike Rathke for the initial patch, for which I expanded
the checks to other functions.
Antonio Radici [Tue, 20 Sep 2016 22:51:13 +0000 (15:51 -0700)]
Use body color for gpgme output. (closes #3872)
When switching from pgp_* commands to crypt_use_gpgme=yes, Peter
Colberg noticed that the output was colored 'brightyellow'.
The issue is that crypt-gpgme.c uses state_attach_puts in various
places where it should use state_puts to maintain compatibility with
the previous behavior in pgp.c.
Richard Russon [Sun, 2 Oct 2016 12:01:06 +0000 (13:01 +0100)]
build fix for strndup / malloc
Some systems don't have strndup() and rely on our version.
I changed it to use Mutt's safe_malloc(), but unfortunately it gets
compiled into some tools which don't have that function.
Richard Russon [Fri, 30 Sep 2016 14:04:16 +0000 (15:04 +0100)]
fix: change gcc build options to prevent crashes
A GCC optimisation "-O2" enables "-fdelete-null-pointer-checks" which
was causing some pointer checks to be optimised out of the code.
This was causing some crashes, most notably in the pager.
Fixes repaint problem with $pager_index_lines #159
Commit 6b4c4ca changed the behaviour of mutt_pager to build the
pager index even if pager_index_lines was set to 0 to (fixing #143).
The code redrawing the pager status line was relying on the pager index
being NULL to determine if a redraw should take place. Now
index_window->rows is used as an additional safeguard.
Also added a check if pager index is set to the terminal status line
update code as it was unguarded and old default behaviour might be
introduced later.
Clemens Lang [Sat, 17 Sep 2016 21:46:19 +0000 (23:46 +0200)]
feature: Add Kyoto Cabinet header cache
Tokyo Cabinet's website now "strongly recommends" using Kyoto Cabinet
instead of Tokyo Cabinet because it claims to be superior. Add Kyoto
Cabinet as an option.
In some preliminary testing, the performance seems to be on-par with
Tokyo Cabinet, but not better. Kyoto Cabinet seems to need a little more
space, but the difference is probably not significant.
Signed-off-by: Clemens Lang <neverpanic@gmail.com>
Johannes Weißl [Wed, 21 Sep 2016 18:10:15 +0000 (20:10 +0200)]
Change 'attach_keyword' option from string to regex
A regular expression is much more useful than a single word to check for
forgotten attachments, especially when writing in multiple languages.
This is inspired by the muttng patchset abort_noattach [1], which I use
for years, but newly implemented to make minimal changes to the neomutt
source code.
The keyword is no longer mentioned in the error message as regular
expressions tend to be longer.
The option 'attach_keyword' could be renamed 'attach_remind_regex' as in
the muttng patch.
* Feedbacks highlighted issues in menu position when people switch
between mailboxes mode and browser mode.
* A preferred behaviour is to have 'c?' display $folder in "local" mode
if existant on startup. For IMAP, we keep using the current directory
in any case.
* A '=' binding have been added:
When in browser mode, not in mailboxes mode, '=' allows to jump back to
$folder from anywhere one is. It stores in a variable the place the
user was. Another hit on '=' will bring him back. When a new directory
is explored, the variable is purged.
* Closes #146
Richard Russon [Fri, 16 Sep 2016 11:22:15 +0000 (12:22 +0100)]
fix sidebar sort order
Collate the sidebar mailboxes for a more natural sort order.
A sorted sidebar will now match a sorted browser.
e.g.
Old Sort New Sort
-------- --------
_apple Apple
_Banana _apple
_Cherry banana
_damson _Banana
Apple Cherry
banana _Cherry
Cherry damson
damson _damson
Richard Russon [Tue, 13 Sep 2016 22:05:16 +0000 (23:05 +0100)]
fix some translations in crypt-gpgme.c
Some translations for crypt-gpgme.c are marked as fuzzy but the keybindings
attached to these translations are not, this creates confusions for the users
who see the english message but have the keybindings for a message in their own
language available.
As long as the translations are fuzzy, the keybindings should stay fuzzy.
Richard Russon [Tue, 13 Sep 2016 16:42:33 +0000 (17:42 +0100)]
merge: upstream fixes (mutt/default)
* Remove the $locale configuration variable.
* Add $attribution_locale configuration variable.
* Add missing include <locale.h> to send.c and edit.c.
* Filter out zero width no-break space (U+FEFF).
* Update a confusing and obsolete comment.
* Moves mutt_copy_list to muttlib.c, where it belongs.
* Redraw screen after an SSL cert prompt
* Preserve message-id and mft headers for recalled messages. (closes #3081)
* Fix openssl 1.1 compilation issues. (closes #3870)
Kevin McCarthy [Sat, 3 Sep 2016 23:19:38 +0000 (16:19 -0700)]
Preserve message-id and mft headers for recalled messages. (closes #3081)
Git patch creates a patch series mailbox, including the Message-ID.
Using this as draft files was removing the Message-ID, and thus
breaking the threaded structure.
The second part of the ticket has already been addressed by 95a2230ef889 (for ticket 3653).
David Champion [Tue, 30 Aug 2016 23:11:45 +0000 (16:11 -0700)]
Update a confusing and obsolete comment.
This 2004 comment in sort.h predicted what has recently come to pass, so
I'm reframing it just to document for future devs what's going on with
this oddball flag.
Kevin McCarthy [Tue, 23 Aug 2016 03:04:52 +0000 (20:04 -0700)]
Remove the $locale configuration variable.
$locale was only used to set the LC_TIME locale. Unfortunately, Mutt
previously defaulted to using "C". This overrode the user's locale
setting and forced them to re-specify their locale inside their
.muttrc.
Remove $locale and instead use the locale specified by the
environment. Mutt still allows "C locale" dates by using a leading
"!" in $date_format, ${}, etc.
Another use of $locale was to customize attribution dates using hooks.
The next commit will introduce $attribution_locale, which can be used
for this instead.
Richard Russon [Mon, 12 Sep 2016 10:25:08 +0000 (11:25 +0100)]
docs: mass tidy up
- tidy muttrc.*
- tidy vimrc.*
- sync muttrc to main manual
- add better xml escaping
- fix whitespace in muttrc/vimrc/manual
- refer to features rather than patches
- fix lots of spelling mistakes
- sort manual sections
- add README.notmuch to dist
- drop unnecessary sample.colors.attach_headers
- install sample muttrc files
- add mutt-1.7.0-syntax.vim from vim repo
- generate neomutt-syntax.vim from features' vimrc files
- install neomutt-syntax.vim
John Swinbank [Sun, 11 Sep 2016 00:15:42 +0000 (20:15 -0400)]
Avoid segfault when listing mailboxes on startup.
When mutt is started with the -y flag, _mutt_select_file() is called while
CurrentFolder is a null pointer. If that's the case, we shouldn't try to use
it.
Richard Russon [Fri, 2 Sep 2016 13:33:01 +0000 (14:33 +0100)]
proposed fix for clearing labels
Debian bug #832971 -- The use claimed he couldn't reset labels.
I couldn't repeat the problem using his config. He offered a patch that
he claimed fixed his problem. Only one part of the patch actually did
anything (and only in a section of code dealing with SETTING labels).