]> granicus.if.org Git - mutt/log
mutt
5 years agoConvert other users of BUFFY->pathbuf to use BUFFERS.
Kevin McCarthy [Wed, 17 Apr 2019 01:11:35 +0000 (18:11 -0700)]
Convert other users of BUFFY->pathbuf to use BUFFERS.

A few functions in browser.c, buffy.c, and monitor.c were using
BUFFY->pathbuf but were potentially truncating via fixed size buffers.
Convert those to use BUFFERS too.

buffy_get() was creating epath and expanding it, apparently to match
against expanded BUFFY list entries, was wasn't using the epath.  I
believe this is a bug, and have switched the comparison to epath.

5 years agoConvert BUFFER->path to a BUFFER.
Kevin McCarthy [Tue, 16 Apr 2019 20:41:10 +0000 (13:41 -0700)]
Convert BUFFER->path to a BUFFER.

Rename to BUFFER->pathbuf to make it clear the field is a BUFFER, and
to make sure to catch and review all usages.

There are still uses of pathbuf that are truncating and need to be
fixed, for example in browser.c and buffy.c.

Fix up sidebar usage in one place, that was pointing inside the
BUFFY->path with a char *.  At the same time, change their "short
folder" computation to also use a BUFFER.

5 years agoChange BUFFY->realpath to be const char *.
Kevin McCarthy [Tue, 16 Apr 2019 19:23:42 +0000 (12:23 -0700)]
Change BUFFY->realpath to be const char *.

BUFFY->path is a fixed array (which will be converted to a BUFFER in
the next commit).  This is needed to call mutt_expand_path().

However, BUFFY->realpath has no such need, and so it is a bit
wasteful (not to mention not big enough) to store as such.

5 years agoAdd a note about $prompt_after to the $pager documentation.
Kevin McCarthy [Tue, 16 Apr 2019 01:43:49 +0000 (18:43 -0700)]
Add a note about $prompt_after to the $pager documentation.

5 years agoRename mutt_buffer_rfc1524_expand_command()
Kevin McCarthy [Sun, 14 Apr 2019 22:38:15 +0000 (15:38 -0700)]
Rename mutt_buffer_rfc1524_expand_command()

Remove buffer prefix now that all callers are converted.

5 years agoConvert rfc1524_expand_command() implementation to use BUFFER.
Kevin McCarthy [Sun, 14 Apr 2019 20:34:37 +0000 (13:34 -0700)]
Convert rfc1524_expand_command() implementation to use BUFFER.

Add mutt_buffer_sanitize_filename() helper.

Add a few end-of-buffer checks while iterating over command.

Convert the parameter name, paramater value, and types to use BUFFER
instead of fixed size strings.

5 years agoConvert last rfc1524_expand_command caller to use a BUFFER.
Kevin McCarthy [Sun, 14 Apr 2019 18:38:49 +0000 (11:38 -0700)]
Convert last rfc1524_expand_command caller to use a BUFFER.

5 years agoRename mutt_buffer_adv_mktemp().
Kevin McCarthy [Sun, 14 Apr 2019 17:46:36 +0000 (10:46 -0700)]
Rename mutt_buffer_adv_mktemp().

Remove buffer prefix since all callers now use this version.

5 years agoConvert remaining mutt_adv_mktemp() calls to use buffer version.
Kevin McCarthy [Sun, 14 Apr 2019 16:20:46 +0000 (09:20 -0700)]
Convert remaining mutt_adv_mktemp() calls to use buffer version.

5 years agoconfigure.ac: fix static build with idn2 and unistring
Fabrice Fontaine [Sun, 14 Apr 2019 08:22:12 +0000 (10:22 +0200)]
configure.ac: fix static build with idn2 and unistring

Commit 78db40f25c6479b14da5a73adf7207bfbec5ccc5 did not fix static build
failure

AC_SEARCH_LIBS prepends the library to LIBS as a result -lunistring is
added before -lidn2. To fix static build, we must set -lunistring after
-lidn2

Fixes:
 - http://autobuild.buildroot.org/results/c9544b4f1a0252e260a2ed19218fa950f4dc2d2d

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
5 years agoGenerate version string during make not configure
Aaron Schrab [Wed, 10 Apr 2019 23:44:46 +0000 (19:44 -0400)]
Generate version string during make not configure

Switch to generating the version string during make process rather than
at configure time.  This makes it easier to keep the detailed version
string accurate when doing development which doesn't require that the
configure script be rerun.

5 years agoRename to mutt_rfc1524_expand_filename().
Kevin McCarthy [Wed, 10 Apr 2019 01:54:20 +0000 (18:54 -0700)]
Rename to mutt_rfc1524_expand_filename().

Now that all callers pass a BUFFER, the buffer prefix is not needed to
distinguish the parameter.

5 years agoConvert mutt_expand_fmt() and rfc1524_expand_filename() to BUFFER.
Kevin McCarthy [Wed, 10 Apr 2019 00:52:14 +0000 (17:52 -0700)]
Convert mutt_expand_fmt() and rfc1524_expand_filename() to BUFFER.

These two functions were tied together and so are converted at the
same time.

Note that rfc1524_expand_filename() had an off-by-one error for the
left hand size of the name template.  It was only copying i-1 instead
of the i characters before %s.

5 years agoConvert mutt_expand_file_fmt() to accept BUFFER dest parameter.
Kevin McCarthy [Tue, 9 Apr 2019 22:20:51 +0000 (15:20 -0700)]
Convert mutt_expand_file_fmt() to accept BUFFER dest parameter.

mutt_expand_fmt() will be converted in the next commit, at the same
time as rfc1524_expand_filename().

5 years agoAdd mutt_buffer_quote_filename().
Kevin McCarthy [Tue, 9 Apr 2019 21:04:36 +0000 (14:04 -0700)]
Add mutt_buffer_quote_filename().

Convert almost all the callers to use the new function.  alias.c usage
is a bit involved, so leave that for now.

Remove unneeded index while converting from mutt_quote_filename().

5 years agoConvert mutt_check_simple() to accept a BUFFER parameter.
Kevin McCarthy [Tue, 9 Apr 2019 02:51:01 +0000 (19:51 -0700)]
Convert mutt_check_simple() to accept a BUFFER parameter.

5 years agoChange autoview_handler() to use BUFFER.
Kevin McCarthy [Mon, 8 Apr 2019 16:51:34 +0000 (09:51 -0700)]
Change autoview_handler() to use BUFFER.

This will allow the full conversion of rfc1524_expand_filename(), and
thereafter mutt_adv_mktemp() too.

5 years agoFix undeclared function warning for mutt_buffy().
Kevin McCarthy [Mon, 8 Apr 2019 17:01:16 +0000 (10:01 -0700)]
Fix undeclared function warning for mutt_buffy().

Not sure why gcc didn't give me the warning, but add buffy.h to
pager.c.

status.c already includes mx.h (which includes buffy.h), but add it
explicitly in any case.

5 years agoChange main() folder to be BUFFER.
Kevin McCarthy [Mon, 8 Apr 2019 01:49:07 +0000 (18:49 -0700)]
Change main() folder to be BUFFER.

This affects the -f, -y, and -Z options directly.

5 years agoCreate mutt_buffer_buffy() buffer function.
Kevin McCarthy [Sun, 7 Apr 2019 23:02:02 +0000 (16:02 -0700)]
Create mutt_buffer_buffy() buffer function.

Relocate some of the buffy function declarations to buffy.h while
adding the new declaration.

5 years agoFix mutt_buffer_select_file() macro to call correct function.
Kevin McCarthy [Sun, 7 Apr 2019 22:56:07 +0000 (15:56 -0700)]
Fix mutt_buffer_select_file() macro to call correct function.

5 years agoChange mutt_folder_hook() parameter to const char *.
Kevin McCarthy [Sun, 7 Apr 2019 22:55:16 +0000 (15:55 -0700)]
Change mutt_folder_hook() parameter to const char *.

5 years agoAdd a note about spam and the header cache in the manual.
Kevin McCarthy [Wed, 3 Apr 2019 21:07:14 +0000 (14:07 -0700)]
Add a note about spam and the header cache in the manual.

5 years agoRestore active flag in imap_fetch_message() on error.
Kevin McCarthy [Tue, 2 Apr 2019 19:43:55 +0000 (12:43 -0700)]
Restore active flag in imap_fetch_message() on error.

5 years agoRemove h->active hack in imap_sync_message_for_copy().
Kevin McCarthy [Tue, 2 Apr 2019 17:58:34 +0000 (10:58 -0700)]
Remove h->active hack in imap_sync_message_for_copy().

Commit 285baf9a improved FLAGS parsing such that "spurious" FLAGS
updates won't cause a mailbox reopen.

Remove the h->active=0 hack because it isn't needed now and makes
reasoning about deletes, purges, and message set generation more
difficult.

5 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 29 Mar 2019 22:29:27 +0000 (15:29 -0700)]
Merge branch 'stable'

5 years agoChange IMAP to try oauthbearer first.
Kevin McCarthy [Fri, 29 Mar 2019 22:21:02 +0000 (15:21 -0700)]
Change IMAP to try oauthbearer first.

$imap_authenticators says if it is unset, the authenticators from
most-secure to secure will be tried.  It makes sense for oauthbearer
to come first, like with POP.

To make this change backwards compatible, it depends on the previous
commit, which changed imap_auth_oauth() to return IMAP_AUTH_UNAVAIL if
oauth is not configured or explictily requested.

5 years agoFail oauth quietly if it was not configured.
Kevin McCarthy [Sun, 24 Mar 2019 01:45:31 +0000 (09:45 +0800)]
Fail oauth quietly if it was not configured.

Don't report an error unless they explicitly put "oauthbearer" in the
authenticator list or configured the oauth_refresh_command.

5 years agoFix typo in documentation.
Kevin McCarthy [Thu, 21 Mar 2019 10:42:38 +0000 (18:42 +0800)]
Fix typo in documentation.

5 years agoAdd documentation on thread tree characters and config vars.
Kevin McCarthy [Thu, 21 Mar 2019 10:35:34 +0000 (18:35 +0800)]
Add documentation on thread tree characters and config vars.

5 years agobrowser.c: Convert f parameter to BUFFER.
Kevin McCarthy [Tue, 12 Mar 2019 06:25:42 +0000 (14:25 +0800)]
browser.c: Convert f parameter to BUFFER.

5 years agobrowser.c: Convert other browser local variables to BUFFER.
Kevin McCarthy [Tue, 12 Mar 2019 05:56:51 +0000 (13:56 +0800)]
browser.c: Convert other browser local variables to BUFFER.

5 years agobrowser.c: Convert buf to BUFFER.
Kevin McCarthy [Tue, 12 Mar 2019 05:26:37 +0000 (13:26 +0800)]
browser.c: Convert buf to BUFFER.

5 years agobrowser.c: Convert prefix to BUFFER.
Kevin McCarthy [Tue, 12 Mar 2019 04:46:56 +0000 (12:46 +0800)]
browser.c: Convert prefix to BUFFER.

5 years agobrowser.c: Convert LastDir and LastDirBackup to BUFFER.
Kevin McCarthy [Mon, 11 Mar 2019 11:08:52 +0000 (19:08 +0800)]
browser.c: Convert LastDir and LastDirBackup to BUFFER.

Add a cleanup method call to main to free the BUFFERS.

Add mutt_buffer_concat_path() buffer helper function.

5 years agoAdd mutt_getcwd().
Kevin McCarthy [Mon, 11 Mar 2019 09:38:58 +0000 (17:38 +0800)]
Add mutt_getcwd().

5 years agoAdd mutt_buffer_strcpy_n().
Kevin McCarthy [Mon, 11 Mar 2019 09:38:18 +0000 (17:38 +0800)]
Add mutt_buffer_strcpy_n().

5 years agoFixes to mutt_buffer_expand_path().
Kevin McCarthy [Mon, 11 Mar 2019 09:04:28 +0000 (17:04 +0800)]
Fixes to mutt_buffer_expand_path().

Create _mutt_buffer_expand_path() with the rx argument.

Use mutt_b2s() instead of derefencing buffer->data in
mutt_buffer_expand_path().  The p->data uses were safe, but the
src->data was potentially not.

5 years agoMerge branch 'stable'
Kevin McCarthy [Wed, 13 Mar 2019 05:47:18 +0000 (13:47 +0800)]
Merge branch 'stable'

5 years agoautomatic post-release commit for mutt-1.11.4 mutt-1-11-4-rel
Kevin McCarthy [Wed, 13 Mar 2019 05:41:00 +0000 (13:41 +0800)]
automatic post-release commit for mutt-1.11.4

5 years agoMerge branch 'stable'
Kevin McCarthy [Wed, 13 Mar 2019 04:39:13 +0000 (12:39 +0800)]
Merge branch 'stable'

5 years agoFix incorrect IMAP message purging bug.
Kevin McCarthy [Wed, 13 Mar 2019 04:06:11 +0000 (12:06 +0800)]
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.

5 years agoAdd mutt_buffer_expand_path().
Kevin McCarthy [Sun, 10 Mar 2019 05:27:11 +0000 (13:27 +0800)]
Add mutt_buffer_expand_path().

TODO: '@' expansion using mutt_default_save() is still using a fixed size
string parameter.

Convert imap_expand_path() and mutt_rx_sanitize_string() to use
BUFFERS instead.

Add url_ciss_tobuffer().

5 years agoFix imap_pretty_mailbox() call to url_ciss_tostring().
Kevin McCarthy [Sun, 10 Mar 2019 12:05:12 +0000 (20:05 +0800)]
Fix imap_pretty_mailbox() call to url_ciss_tostring().

Pass the correct buffer size through, so the strfcpy added in the next
commit doesn't write past the end of the buffer.

5 years agoMove mutt_rx_sanitize_string() to muttlib.c
Kevin McCarthy [Sun, 10 Mar 2019 05:35:26 +0000 (13:35 +0800)]
Move mutt_rx_sanitize_string() to muttlib.c

So it can be converted to use BUFFER.

5 years agoImprove imap uid seqset hcache buffer usage.
Kevin McCarthy [Sun, 10 Mar 2019 02:03:52 +0000 (10:03 +0800)]
Improve imap uid seqset hcache buffer usage.

mutt_buffer_increase_size() terminates the buffer, so there is no need
to explicitly check for an empty buffer after the
imap_msn_index_to_uid_seqset() call.

5 years agoMinor buffer handling code cleanup.
Kevin McCarthy [Sun, 10 Mar 2019 01:58:07 +0000 (09:58 +0800)]
Minor buffer handling code cleanup.

Use mutt_buffer_len() and mutt_buffer_clear() to make the code a bit
clearer.  There are still places in the code that manipulate the
buffers directly (pattern.c, for example), but that doesn't mean we
shouldn't abstract the buffer where we can.

Add comments in a couple places where unusual buffer manipulation is
occurring.

5 years agoAdd "Message Composition Flow" section to manual.
Kevin McCarthy [Sat, 9 Mar 2019 11:12:19 +0000 (19:12 +0800)]
Add "Message Composition Flow" section to manual.

This provides a brief overview of the steps during message
composition, and shows when the various hooks are executed.

5 years agoExpand a couple of the comments about charset.
Kevin McCarthy [Sat, 9 Mar 2019 07:03:00 +0000 (15:03 +0800)]
Expand a couple of the comments about charset.

Make it clearer what BODY->charset is used for, and why we are
checking for !noconv during mailcap charset parameter expansion.

5 years agoCheck noconv for mailcap %{charset} send mode expansion.
Kevin McCarthy [Fri, 8 Mar 2019 11:48:41 +0000 (19:48 +0800)]
Check noconv for mailcap %{charset} send mode expansion.

Improve the previous commit by checking to make sure a->noconv also
isn't set.  If noconv is set, we ignore any value a->charset might
have picked up during previous encoding checks.

5 years agoFix mailcap %{charset} expansion in send mode.
Kevin McCarthy [Fri, 8 Mar 2019 10:06:52 +0000 (18:06 +0800)]
Fix mailcap %{charset} expansion in send mode.

Use the current charset of the file for the parameter, since the file
hasn't been converted yet.

5 years agoUse gpgme recipient strings for encryption when available.
Kevin McCarthy [Mon, 4 Mar 2019 07:05:50 +0000 (15:05 +0800)]
Use gpgme recipient strings for encryption when available.

For gpgme >= 1.11.0, use gpgme_op_encrypt_ext() and
gpgme_op_encrypt_sign_ext() to specify recipients as a string.

This allows '!' to specify forcing a subkey, as is the case in classic
gpg and from the command line.

Remove the '!' "force valid" usage for the newer version.

5 years agoAdd $include_encrypted config to prevent reply-decryption attack.
Kevin McCarthy [Fri, 22 Feb 2019 21:50:52 +0000 (13:50 -0800)]
Add $include_encrypted config to prevent reply-decryption attack.

@jensvoid, in cooperation with Ruhr-Uni Bochum and FH Münster,
Germany, reported a possible "Oracle decryption" attack on various
mail clients.  An attacker could include previously encrypted contents
they obtained access to, and include it in a message.  Replying
without trimming would include the decrypted contents.

This attack relies on several "ifs", and is more dangerous for clients
that compose HTML mail.  However, it is still an issue that an
unwary/busy Mutt user could fall for.

Add a new config $include_encrytped, defaulting off, to reduce the
possibility of the user being unaware of previously encrypted parts in
the reply.  Only the main initial encrypted part will be included in
the reply.

5 years agoAdd additional search names for docbook texi conversion program.
Kevin McCarthy [Sat, 23 Feb 2019 20:12:36 +0000 (12:12 -0800)]
Add additional search names for docbook texi conversion program.

On Arch, it is called docbook2text

5 years agoFix truncation of long filenames in attachments.
Andrey Skvortsov [Thu, 21 Feb 2019 13:37:05 +0000 (16:37 +0300)]
Fix truncation of long filenames in attachments.

Currently mutt truncates long filenames in attachments and doesn't
take into account UTF-8 character size. If filename is truncated in
the middle of multi-byte UTF-8 character (last character is bad),
then some mail clients assume whole attachment name bad and don't
display its name (use 'Noname' instead).

Filenames can be up to 255 *characters* long depending on used
filesystem. ReiserFS, NFTS, FAT, APFS and some other supports up to
255 characters.
In the worst case 255 characters in UTF-8 will take 255*4 = 1020
bytes. Every non-ascii byte in the filename will be encoded using 3
bytes (for example, %8D).
So 'Content-Disposition' will take in the worst case up to: 1020*3 =
3060 bytes. Therefore even LONG_STRING (1024) isn't enough.

5 years agoCheck the base64 decoding retval in auth_gss.
Kevin McCarthy [Wed, 13 Feb 2019 03:04:28 +0000 (19:04 -0800)]
Check the base64 decoding retval in auth_gss.

Abort if the value is not decodable.

5 years agoChange auth_gss to to use buffers and the buffer pool.
Kevin McCarthy [Wed, 13 Feb 2019 00:41:07 +0000 (16:41 -0800)]
Change auth_gss to to use buffers and the buffer pool.

Ticket #100 revealed that even a bufsize of 8192 isn't guaranteed to
be big enough.  Convert those large buffers to use the buffer pool
instead.

5 years agoAdd mutt_buffer helpers for base64 conversion.
Kevin McCarthy [Tue, 12 Feb 2019 23:58:13 +0000 (15:58 -0800)]
Add mutt_buffer helpers for base64 conversion.

Add mutt_buffer_from_base64() mutt_buffer_to_base64() to help with
transitioning to buffers.

5 years agoAdd mutt_buffer_len() helper.
Kevin McCarthy [Tue, 12 Feb 2019 23:48:09 +0000 (15:48 -0800)]
Add mutt_buffer_len() helper.

5 years agoUpdated French translation.
Vincent Lefevre [Thu, 7 Feb 2019 22:48:09 +0000 (23:48 +0100)]
Updated French translation.

5 years agoCreate <group-chat-reply> function.
Kevin McCarthy [Wed, 6 Feb 2019 22:29:42 +0000 (14:29 -0800)]
Create <group-chat-reply> function.

This function differs from <group-reply> only in that it preserves To
recipients in the original email as To recipients in the reply.

The merits of this function aren't without controversy; therefore it
is left unbound by default.  Those who care about such things are free
to bind it.

Combine reply operation handlers in the pager and curs_main, since the
code was the same with the exception of the flags used.

5 years agoUpdated French translation.
Vincent Lefevre [Wed, 6 Feb 2019 12:58:42 +0000 (13:58 +0100)]
Updated French translation.

5 years agocorrected typo from dad0eb255fddbef5f14772b85b32acf6f2ca7996
Vincent Lefevre [Wed, 6 Feb 2019 12:53:30 +0000 (13:53 +0100)]
corrected typo from dad0eb255fddbef5f14772b85b32acf6f2ca7996

5 years agoAdd an error message for <descend-directory>.
Kevin McCarthy [Sat, 2 Feb 2019 23:35:34 +0000 (15:35 -0800)]
Add an error message for <descend-directory>.

Don't allow the operation on a non-directory.  Print a message
indicating it's not a directory.

5 years agoSeparate out op variable in the browser.
Kevin McCarthy [Sat, 2 Feb 2019 23:03:03 +0000 (15:03 -0800)]
Separate out op variable in the browser.

The i variable is used in several places and scopes as a temporary
index variable, but is also used to record the current operation.
Separate them out to make the code less confusing.

5 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 1 Feb 2019 20:52:58 +0000 (12:52 -0800)]
Merge branch 'stable'

5 years agoautomatic post-release commit for mutt-1.11.3 mutt-1-11-3-rel
Kevin McCarthy [Fri, 1 Feb 2019 20:41:23 +0000 (12:41 -0800)]
automatic post-release commit for mutt-1.11.3

5 years agoUpdate UPDATING file for 1.11.3 release.
Kevin McCarthy [Fri, 1 Feb 2019 20:34:19 +0000 (12:34 -0800)]
Update UPDATING file for 1.11.3 release.

5 years agoAllow descending into maildir and mh directories in file browser
Corey Minyard [Thu, 31 Jan 2019 23:57:57 +0000 (17:57 -0600)]
Allow descending into maildir and mh directories in file browser

Some (maybe most) IMAP mail systems allow folders to be nested inside
folders, so you can have, say, an Inbox with more folders inside it.
However, in the file browser, mutt will only open a maildir/mh
directory as a mailbox, there is no way to get to the child mailboxes.

This change adds a function <descend-directory> that forces mutt to
descend into the directory.  It is unbound by default.

Signed-off-by: Corey Minyard <minyard@acm.org>
5 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 25 Jan 2019 02:51:55 +0000 (18:51 -0800)]
Merge branch 'stable'

5 years agoShow top-level decoded smime text/plain parts.
Kevin McCarthy [Fri, 25 Jan 2019 02:28:27 +0000 (18:28 -0800)]
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.

5 years agoSimplify nested smime handling in the attachment menu.
Kevin McCarthy [Thu, 24 Jan 2019 23:19:36 +0000 (15:19 -0800)]
Simplify nested smime handling in the attachment menu.

Since changeset 2fd6f99b allows nested encryption handling, there is
no need to deal with the nesting directly.  Instead, just recursive as
with other nested handling.

5 years agoMerge branch 'stable'
Kevin McCarthy [Thu, 24 Jan 2019 23:07:36 +0000 (15:07 -0800)]
Merge branch 'stable'

5 years agoImprove attachment menu for s/mime parts. (closes #113)
Kevin McCarthy [Thu, 24 Jan 2019 22:15:33 +0000 (14:15 -0800)]
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.

5 years agoMerge branch 'stable'
Kevin McCarthy [Tue, 22 Jan 2019 03:45:28 +0000 (19:45 -0800)]
Merge branch 'stable'

5 years agoFix tunnels to also retry and write full buffer.
Kevin McCarthy [Tue, 22 Jan 2019 03:43:08 +0000 (19:43 -0800)]
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.

5 years agoMerge branch 'stable'
Kevin McCarthy [Mon, 21 Jan 2019 23:34:46 +0000 (15:34 -0800)]
Merge branch 'stable'

5 years agoFix raw socket read/write to follow expected behavior.
Kevin McCarthy [Mon, 21 Jan 2019 23:19:08 +0000 (15:19 -0800)]
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.

5 years agoRemove mutt_socket_read().
Kevin McCarthy [Mon, 21 Jan 2019 22:16:13 +0000 (14:16 -0800)]
Remove mutt_socket_read().

It is not used anywhere in the code.

Additionally, it does not interact correctly with
mutt_socket_readchar() and mutt_socket_readln_d(), which use an
internal input buffer: conn->inbuf.

If reading a specific chunksize is needed in future, the function can
be easily recreated to use the inbuf.

5 years agoMerge branch 'stable'
Kevin McCarthy [Mon, 21 Jan 2019 20:11:27 +0000 (12:11 -0800)]
Merge branch 'stable'

5 years agoConvert to use gitlab registry image ubuntu:18.04.
Kevin McCarthy [Fri, 30 Nov 2018 23:12:47 +0000 (15:12 -0800)]
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)

5 years agoMerge branch 'stable'
Kevin McCarthy [Mon, 21 Jan 2019 20:02:54 +0000 (12:02 -0800)]
Merge branch 'stable'

5 years agoFix gnutls tls_socket_write() to properly retry.
Kevin McCarthy [Mon, 21 Jan 2019 19:56:04 +0000 (11:56 -0800)]
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).

5 years agoChange $pgp_use_gpg_agent to default set.
Kevin McCarthy [Sat, 19 Jan 2019 23:23:32 +0000 (15:23 -0800)]
Change $pgp_use_gpg_agent to default set.

GnuPG 2.1.0, released in 2014-11-06, automatically spawns an agent.
After 4+ years, it has reached wide enough usage to merit changing the
default.

5 years agoMerge branch 'stable'
Kevin McCarthy [Sat, 19 Jan 2019 05:01:09 +0000 (21:01 -0800)]
Merge branch 'stable'

5 years agoUpdate the muttrc man page with added commands.
Kevin McCarthy [Sat, 19 Jan 2019 04:46:07 +0000 (20:46 -0800)]
Update the muttrc man page with added commands.

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

Add the HMS relative date units.

5 years agoMerge branch 'stable'
Kevin McCarthy [Sat, 19 Jan 2019 03:46:33 +0000 (19:46 -0800)]
Merge branch 'stable'

5 years agoWrap ssl init calls for LibreSSL too.
Kevin McCarthy [Thu, 10 Jan 2019 17:56:41 +0000 (09:56 -0800)]
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.

5 years agoUpdated date of the mutt(1) man page.
Vincent Lefevre [Fri, 18 Jan 2019 12:59:05 +0000 (13:59 +0100)]
Updated date of the mutt(1) man page.

5 years agoUpdated date of the muttrc(5) man page.
Vincent Lefevre [Fri, 18 Jan 2019 12:57:20 +0000 (13:57 +0100)]
Updated date of the muttrc(5) man page.

5 years agoAdd attributes support on color declarations
Muh Muhten [Tue, 15 Jan 2019 06:17:02 +0000 (01:17 -0500)]
Add attributes support on color declarations

color now accepts zero or more attributes words before the foreground.

Also more or less resolves the issue that setting the color of an object
which defaults to underline/reverse is irreversible.

5 years agoMerge branch 'stable'
Kevin McCarthy [Thu, 10 Jan 2019 17:45:13 +0000 (09:45 -0800)]
Merge branch 'stable'

5 years agomx_open_mailbox: provide output buffer to realpath(3)
Fabian Groffen [Thu, 10 Jan 2019 15:03:02 +0000 (16:03 +0100)]
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>
5 years agoMerge branch 'stable'
Kevin McCarthy [Tue, 8 Jan 2019 21:10:06 +0000 (13:10 -0800)]
Merge branch 'stable'

5 years agoFix compilation with LibreSSL <2.7.0. (closes #112)
Stefan Strogin [Tue, 8 Jan 2019 19:18:38 +0000 (21:18 +0200)]
Fix compilation with LibreSSL <2.7.0. (closes #112)

(cherry picked from commit 9c9bea5e04e2a562017af0ac7a27b1b0e00e8907)

5 years agoFix compilation with LibreSSL <2.7.0. (closes #112)
Stefan Strogin [Tue, 8 Jan 2019 19:18:38 +0000 (21:18 +0200)]
Fix compilation with LibreSSL <2.7.0. (closes #112)

5 years agoMerge branch 'stable'
Kevin McCarthy [Tue, 8 Jan 2019 01:49:27 +0000 (17:49 -0800)]
Merge branch 'stable'

5 years agoautomatic post-release commit for mutt-1.11.2 mutt-1-11-2-rel
Kevin McCarthy [Tue, 8 Jan 2019 01:39:19 +0000 (17:39 -0800)]
automatic post-release commit for mutt-1.11.2

5 years agoAdd UPDATING notes for 1.11.2 release.
Kevin McCarthy [Tue, 8 Jan 2019 01:26:53 +0000 (17:26 -0800)]
Add UPDATING notes for 1.11.2 release.

5 years agoFix mkdtemp() random signedness
Eike Rathke [Sat, 5 Jan 2019 21:54:26 +0000 (22:54 +0100)]
Fix mkdtemp() random signedness

time_t return of time() may be signed 32-bit and in that case
probably will roll over in the year 2038 and yield a negative
value; signedness was propagated in the XOR operation to the
'value' and then 'v' variables. The 'v % 62' operation then would
had resulted in a negative value and LETTER[v%62] would had
accessed an arbitrary data location.

The same could had happened if the static long 'value' variable
after a very long run time contained a sufficiently large value to
which the time^pid value added resulted in a wrap / roll-over to a
negative value.

Using unsigned long types for 'value' and 'v' and casting time_t
to unsigned long cures all this.