~kevin8t8/mutt

automatic post-release commit for mutt-1.11.4
Fix incorrect IMAP message purging bug.

Thanks to Ivan Middleton @imiddle for the awesome bug report and
suggested fix.

The bug is most easily generated using Gmail with the $trash variable
set.

Deleted messages are first copied to the $trash folder.  If this is
set to "[Gmail]/Trash", then Gmail inteprets the copy as a "delete"
and sends EXPUNGE messages back for the messages.

cmd_parse_expunge() and cmd_parse_vanished() set the hdr->index to
INT_MAX, which subsequently an imap_expunge_mailbox() will use to
remove the messages from the local mailbox.

If we close the mailbox instead of sync it, Mutt will end up executing
the 'Deleted' flag setting before processing the expunge (because
"imap_check_mailbox() -> imap_cmd_finish()' doesn't set check_status
when we are closing).  The expunged messages will then be included in
the set of 'Deleted' flags.

Unfortunately, because the messages are sorted by *index* before
msgset generation, an incorrect range of UIDs will be sent, which
could easily include messages that should not be deleted.

This fix is a minimal fix for a stable bug fix  excluding
messages with the index set to INT_MAX from all msg sets.  Other
things that should be investigated in master are:

- sorting by UID instead of index before msgset generation
- unsetting the 'active' flag in cmd_parse_expunge() and
  cmd_parse_vanished() instead of waiting until imap_expunge_mailbox()
  to do so.
automatic post-release commit for mutt-1.11.3
Update UPDATING file for 1.11.3 release.
Show top-level decoded smime text/plain parts.

Commit 331d9d5a attempted to fix a problem with an attachment having
extension .p7m.  The attachment menu tried to decode and failed, and
the part ended up being replaced by a bogus text/plain part.

The problem is that crypt_smime_decrypt_mime() returns a text/plain
part if the decode fails, meaning we can't distinguish failure from
success in this case.

As a compromise, only use a text/plain resulting from a single
top-level application_smime part.  This will allow for the case of an
text/plain encoded email, but won't end up hiding attachments that
were not decoded.
Improve attachment menu for s/mime parts. (closes #113)

Don't prompt for passphrase or getkeys, or set the ENCRYPT flag, for
OPAQUE types.

Don't recurse on "text" output from decrypt_mime().  There is no
reason to recurse on a text type.  Additionally, the
mutt_read_mime_header() will return an empty text type even if the
decode doesn't generate mime output.  In those cases, we want to show
the original attachment.
Fix tunnels to also retry and write full buffer.

Change the tunnel_socket_read() and tunnel_socket_write() as the raw
sockets were adjusted in the previous commit.  Retry on EINTR, and
complete a full write so all the implementations have the same behavior.
Fix raw socket read/write to follow expected behavior.

The mutt_sasl.c code expects conn_write() to write the entire buffer.
This is inconsistent with mutt_socket.c, but since other conn_write()
implementations guarantee this, change raw_socket_write() to do so too
for now.

Also, update reading and writing to loop on EINTR, as gnutls does.
They won't return EAGAIN or EWOULDBLOCK because we don't mark sockets
as non-blocking.
Convert to use gitlab registry image ubuntu:18.04.

The gitlab registry image is built using the Dockerfile in
muttmua/docker-images/tree/master/ubuntu/18.04/

Turn off the scan-build-5.0.  I never look at those reports and they
run very slowly.

Also, for now just compile for gnutls, to speed up the check further.

(cherry picked from commit f34cb1fb8468f74894818343dd8d95da5c0c640d)
Fix gnutls tls_socket_write() to properly retry.

Retry on GNUTLS_E_AGAIN and GNUTLS_E_INTERRUPTED.  This prevents an
aborted send due to a SIGWINCH, for instance.

Change tls_socket_read() to follow the same flow.  Don't bother
checking gnutls_error_is_fatal() because return codes besides AGAIN
and INTERRUPTED end up closing the connection regardless.  (We don't
handle handshakes and negotations during send/receive).
Update the muttrc man page with added commands.

Add the "color compose", index-format-hook, and echo commands.

Add the HMS relative date units.
Wrap ssl init calls for LibreSSL too.

It looks like LibreSSL does not perform automatic initialization of
the library and error strings.

Since LibreSSL defines OPENSSL_VERSION_NUMBER as a "version 2",
add a check if LIBRESSL_VERSION_NUMBER is defined and call the
initialization functions for that case.
42101583 — Fabian Groffen 1 year, 4 months ago
mx_open_mailbox: provide output buffer to realpath(3)

Starting with POSIX.1.2008 resolved_path can be NULL.
Systems implementing a standard before that crash.  Example of such
system is Mac OS X 10.5, the last version running on PowerPC hardware.

Since this is the only occurrance of the realpath(3) function in Mutt,
instead of wrapping it, just adjust this invocation.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
83585f9b — Stefan Strogin 1 year, 4 months ago
Fix compilation with LibreSSL <2.7.0. (closes #112)

(cherry picked from commit 9c9bea5e04e2a562017af0ac7a27b1b0e00e8907)
automatic post-release commit for mutt-1.11.2
Add UPDATING notes for 1.11.2 release.
Update copyright for the next stable release.
Fix mkdtemp.c implementation.

Two statements were indented on the same line under a for statement.
The second one would not be included in the loop, only being executed
after the loop finishes.

This is obviously an error, as it modifies the LETTERS entry being
used.
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.
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.
Next