Richard Russon [Tue, 26 Sep 2017 23:17:56 +0000 (00:17 +0100)]
merge: rename mutt to neomutt
* rename man pages
* move helper programs to lib dir
* move mime.types to doc dir
* contrib: change mutt references to neomutt
* build: don't install .dist files
Richard Russon [Tue, 26 Sep 2017 14:20:38 +0000 (15:20 +0100)]
merge: upstream fixes (mutt/default)
* clang-format
* Display an error message when delete mailbox fails. (see #3968)
* Updated French translation.
* Fix imap sync segfault due to inactive headers during an expunge. (closes #3971)
* Close the imap socket for the selected mailbox on error.
* Add missing IMAP_CMD_POLL flag in imap buffy check.
* Change maildir and mh check_mailbox to use dynamic sized hash. (closes #3973)
Kevin McCarthy [Tue, 26 Sep 2017 01:40:32 +0000 (18:40 -0700)]
Change maildir and mh check_mailbox to use dynamic sized hash. (closes #3973)
The original patch is by Matt Fleming, originally posted at
http://www.codeblueprint.co.uk/2017/01/15/a-kernel-devs-approach-to-improving2
The comments there indicate Matt tried to submit to trac and mutt-dev,
but ran into registration problems. Thank you for the patch, and
sorry for those problems, Matt.
I modified the patch by making the same change to the
mh_check_mailbox() code too.
Kevin McCarthy [Fri, 22 Sep 2017 18:12:25 +0000 (11:12 -0700)]
Close the imap socket for the selected mailbox on error.
The new $imap_poll_timeout calls the cmd_handle_fatal() error handler
on timeout, which is supposed to close and cleanup.
However, for the currently selected mailbox, the error handler was not
closing the socket after closing up the mailbox. This left extra
SSL/GnuTLS data around and was causing errors on an attempt to
reconnect.
Kevin McCarthy [Fri, 22 Sep 2017 18:07:27 +0000 (11:07 -0700)]
Fix imap sync segfault due to inactive headers during an expunge. (closes #3971)
Mutt has several places where it turns off h->active as a hack. For
example to avoid FLAG updates, or to exclude from imap_exec_msgset.
Unfortunately, when a reopen is allowed and the IMAP_EXPUNGE_PENDING
flag becomes set (e.g. a flag update to a modified header),
imap_expunge_mailbox() will be called by imap_cmd_finish().
The mx_update_tables() would free and remove these "inactive" headers,
despite that an EXPUNGE was not received for them. This would result
in memory leaks and segfaults due to dangling pointers in the
msn_index and uid_hash.
There should probably be a more elegant solution, removing the initial
hacks. However, this is causing a segfault, and the best solution
right now is to turn active back on for non-expunged messages in
imap_expunge_mailbox().
Extra thanks to chdiza, who bravely runs tip and found this issue
quickly.
Tokenize buffer and expand each token (path) and finally unsubscribe from it.
No pattern matching is done.
* Added subscribe-to command and updated example
* Added `subscribe-to` command (init.h)
* Added `parse_subscribe_to` prototype (init.h)
* Implemented `parse_subscribe_to` uses imap/imap.h Header (init.c)
* Example now shows folder and subfolders
Tokenize buffer and expand each token (path) and finally subscribe from it.
No pattern matching is done.
* Added return check
It should be noted, that imap_subscribe(FOO, 0) /* unsubcribe */
won't return -1, if mailbox doesn't exists.
* Added return -1, and do not silently ignore
* Added braces to satisfy styleguides
* Added better user output
* Typo Successfull -> Successful
* Reverted back to one parameter only and errors into err.
* Reverted back to one parameter only.
* Better error messages
* Error messages are now stored inside struct Buffer *err
* Changed from strfcpy -> mutt_buffer_*
* Copy&Paste Error correction
* Cleanup
* set expandtab
* set tabstop=2
* merged mutt_buffer_addstr -> mutt_buffer_printf
* corrected "Corrupted buffer" -> mutt_debug(5, ...)
* Compared with clang-format to get sure
* Reverted back bool -> int, to change this in a later PR
inside `parse_unsubscribe_from(...)` and `parse_subscribe_to(...)`
for the `imap_subscribe(...)`-call.
Kevin McCarthy [Wed, 13 Sep 2017 22:48:16 +0000 (15:48 -0700)]
Change imap copy/save and trash to sync flags, excluding deleted. (closes #3966) (closes #3860)
imap_copy_messages() uses a helper to sync the flags before performing
a server-side copy. However, it had a bug that the "deleted" flag on
a local message, if set, will be propagated to the copy too.
Change the copy sync helper to ignore the deleted flag. Then, change
the imap trash function to use the same helper.
Thanks to Anton Lindqvist for his excellent bug report, suggested
fixes, and help testing.
Kevin McCarthy [Wed, 13 Sep 2017 22:48:13 +0000 (15:48 -0700)]
Remove \Seen flag setting for imap trash. (see #3966) (see #3860)
Commit 323e3d6e5e4c has a side effect where spurious FETCH flag
updates after setting the \Seen flag can cause a sync to abort.
Remove manually setting \Seen for all trashed message before copying.
The next commit will change the imap trash function to use the same
code as the imap copy/save function for syncing the message before
server-side copying.
Florian Klink [Thu, 31 Aug 2017 02:21:26 +0000 (04:21 +0200)]
mutt_notmuch: fix setting custom query_type in notmuch query
nm_normalize_uri re-builds notmuch queries, but nm_uri_from_query
doesn't set query_type back again, so fix that.
Also, use the NmQueryType enum where possible instead of int.
Richard Russon [Wed, 6 Sep 2017 01:41:47 +0000 (02:41 +0100)]
merge: tidying in preparation for config changes
* lib: move more functions into the library
* rename DT_ consts
* rename: rx -> regex
* rename: Unify the multi-byte char table naming
* rename: OPT_* to match their config item
* rename: Global variables to match their config item
Richard Russon [Mon, 4 Sep 2017 18:16:37 +0000 (19:16 +0100)]
rename: Global variables to match their config item
Rename lots of constants to match the user-facing config names.
e.g.
"certificate_file" SslCertFile -> CertificateFile
"nm_open_timeout" NotmuchOpenTimeout -> NmOpenTimeout
Richard Russon [Mon, 4 Sep 2017 17:12:10 +0000 (18:12 +0100)]
rename: OPT_* to match their config item
Rename lots of constants to match the user-facing config names.
e.g.
"forward_decode" OPT_FORW_DECODE -> OPT_FORWARD_DECODE
"imap_servernoise" OPT_IMAP_SERVER_NOISE -> OPT_IMAP_SERVERNOISE
Kevin McCarthy [Mon, 4 Sep 2017 20:26:55 +0000 (13:26 -0700)]
Add warning about using inline pgp with format=flowed. (closes #3963)
The reporter noted that when trying to use inline signing with
format=flowed, the flowed was turned off.
After some research, this appears to be deliberate, probably because
of strange interactions between inline PGP and format=flowed. In fact
the RFC strongly discourages their combined use:
https://tools.ietf.org/html/rfc3676#section-4.6
Add a warning and prompt to use PGP/MIME in mutt_protect().
Kevin McCarthy [Sat, 2 Sep 2017 16:36:52 +0000 (09:36 -0700)]
Fix the new certificate prompt translations.
The Esperanto, Dutch, and Czech po files weren't updated in time for
1.9. Fix the certificate prompt translations by adding a "(s)kip"
choice. Otherwise the prompts would not be functional.
Richard Russon [Fri, 1 Sep 2017 12:45:23 +0000 (13:45 +0100)]
merge: upstream fixes (mutt/default)
* Create ATTACH_CONTEXT to hold attachment index. (see #3728)
* Change helpers functions to pass actx. (see #3728)
* Add helpers to add and remove actx entries. (see #3728)
* Change recvattach to allow nested encryption. (see #3728)
* Add virtual index to actx. (see #3728)
* Fix the expand/collapse code to use the virtual index. (see #3728)
* Fix shared attachment functions. (see #3728)
* Fix attachment check_traditional and extract_keys operations. (see #3728)
* Add edit-content-type helper and warning for decrypted attachments. (closes #3728)
* Fix parent_hdr usage in mutt_attach_reply(). (see #3728)
* Add option to run command to query attachment mime type. (closes #2933) (closes #3959)
Kevin McCarthy [Fri, 11 Aug 2017 16:04:48 +0000 (09:04 -0700)]
Fix parent_hdr usage in mutt_attach_reply(). (see #3728)
If the selected attachments are not messages and no (common) parent is
found, parent_hdr is set to the passed in hdr. In that case, parent
will still be NULL, but parent_hdr and parent_fp will be set.
Change the test to parent_hdr being NULL, not parent, to check for
this case.
Kevin McCarthy [Fri, 11 Aug 2017 01:18:28 +0000 (18:18 -0700)]
Add edit-content-type helper and warning for decrypted attachments. (closes #3728)
Regenerating the actx index will overwrite any changes made to a
decrypted attachment. Change the mutt_edit_content_type() function to
return 1 when a structural change is made. Add a warning message when
that is the case and a decrypted message was edited, so the user is
not surprised.
Note: mutt_edit_content_type() appeared to regenerate multipart
subparts every time, leading to a memory leak. I believe this was an
oversite, and it should have regenerated only when there were no
subparts, so have "fixed" this.
Kevin McCarthy [Fri, 11 Aug 2017 01:18:25 +0000 (18:18 -0700)]
Fix shared attachment functions. (see #3728)
With nested decryption, the correct FP is associated with the
ATTACHPTR entry. Also, the BODY entries are not continguous, so the
functions need to iterate over the actx index, not the BODY structure.