]> granicus.if.org Git - mutt/log
mutt
5 years agoAdd a test for NULL parameter attribute too.
Kevin McCarthy [Mon, 6 May 2019 19:37:04 +0000 (12:37 -0700)]
Add a test for NULL parameter attribute too.

Just to be sure we don't have any issues with the new continuation
code.  The mutt_set_parameter() code doesn't actively prevent a null
attribute.

5 years agoAdd a manual section on OpenPGP and S/MIME configuration.
Kevin McCarthy [Sun, 5 May 2019 20:26:59 +0000 (13:26 -0700)]
Add a manual section on OpenPGP and S/MIME configuration.

Talk about the required config variables, GPGME and classic mode,
agents, pinentry programs, and smime_keys.

5 years agoWrite rfc2231 parameter continuations for long parameters.
Kevin McCarthy [Thu, 2 May 2019 19:31:29 +0000 (12:31 -0700)]
Write rfc2231 parameter continuations for long parameters.

Previously, Mutt would truncate long attachment filenames, to avoid
writing an illegal length header line.  This commit is a followup to
4dcb3ba1, where I reverted an incorrect fix for the problem.

rfc2231_encode_string() now returns a list of continuations, with
encoding and continuation number suffixes already appended to the
attribute.  The function tries to keep the line length less than 78
characters, but the code is a bit imprecise as a trade off for
simplicity and readability.

Modify mutt_write_mime_header() to loop through the continuations.

5 years agoMissing word in UPDATING file.
Vincent Lefevre [Thu, 2 May 2019 13:44:16 +0000 (15:44 +0200)]
Missing word in UPDATING file.

5 years agoMinor UPDATING file fix.
Kevin McCarthy [Wed, 1 May 2019 22:23:04 +0000 (15:23 -0700)]
Minor UPDATING file fix.

5 years agoUPDATING file cleanups.
Kevin McCarthy [Wed, 1 May 2019 13:52:37 +0000 (06:52 -0700)]
UPDATING file cleanups.

Second quick pass.

5 years agoUpdate UPDATING file.
Kevin McCarthy [Wed, 1 May 2019 03:04:12 +0000 (20:04 -0700)]
Update UPDATING file.

This is a first pass to get something out quickly to testers.

5 years agoUpdated French translation.
Vincent Lefevre [Mon, 29 Apr 2019 11:03:44 +0000 (13:03 +0200)]
Updated French translation.

5 years agoCorrected minor errors in text related to $forward_attachments.
Vincent Lefevre [Mon, 29 Apr 2019 10:49:22 +0000 (12:49 +0200)]
Corrected minor errors in text related to $forward_attachments.

5 years agoFix mailbox search to not recompile for a repeated search.
Kevin McCarthy [Sun, 28 Apr 2019 22:48:33 +0000 (15:48 -0700)]
Fix mailbox search to not recompile for a repeated search.

The LastSearchExpn was being compared, but was never set to the
expanded search value.  This was causing the search to be recompiled
even if it were for the same previous expanded search string.

5 years agoNote the other parts of generated message-ids in the manual.
Kevin McCarthy [Sun, 28 Apr 2019 21:59:13 +0000 (14:59 -0700)]
Note the other parts of generated message-ids in the manual.

5 years agoAdd $forward_attachments quadoption for inline-forward mode.
Kevin McCarthy [Fri, 26 Apr 2019 02:41:04 +0000 (19:41 -0700)]
Add $forward_attachments quadoption for inline-forward mode.

When set or answered yes, non text-decodable parts will be attached to
the new message.  The default value is "ask-yes", because I believe
this is something people will want to use, and should be made aware of
the new possible behavior.

The option presents a nice middle ground between previous
inline-forwarding behavior (where all the non-text parts were
dropped), and $mime_forward where the entire email was included as an
attachment.

This was previously difficult to achieve, but after the
recv-attachment refactoring: (a19e5266^..faabd621)
it became possible to use the ATTACH_CONTEXT and the recvattach.c
helper mutt_generate_recvattach_list() to properly deal with nesting
and multiple file-handles.

5 years agoAdd note about IMAP browser and trailing delimiters.
Kevin McCarthy [Thu, 25 Apr 2019 16:26:43 +0000 (09:26 -0700)]
Add note about IMAP browser and trailing delimiters.

This is the same behavior as the regular browser, but I think still
deserves a quick mention.

Thanks to Charles for pointing out this section of the manual and
suggesting the addition.

5 years agoAdd RECURSIVEMATCH LIST-EXTENDED selection option to query.
Kevin McCarthy [Wed, 24 Apr 2019 02:06:11 +0000 (19:06 -0700)]
Add RECURSIVEMATCH LIST-EXTENDED selection option to query.

LSUB is required to include mailboxes with subscribed children, but
the just added "LIST (SUBSCRIBED)" by default does not do that.

To match previous behavior, add RECURSIVEMATCH to make sure the
children are included.  Fix the parser to trim off the CHILDINFO
suffix in the response.

Parse \NonExistent LIST attribute the same as \NoSelect.

5 years agoEnable the use of toggle-write from the pager.
Jeremy Sowden [Tue, 23 Apr 2019 21:15:31 +0000 (22:15 +0100)]
Enable the use of toggle-write from the pager.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
5 years agoImprove hierarchy information accuracy in IMAP browser
Naveen Nathan [Tue, 23 Apr 2019 17:04:05 +0000 (03:04 +1000)]
Improve hierarchy information accuracy in IMAP browser

Currently the IMAP browser relies on LIST and LSUB (for listing subscribed
folders) which may not provide the required hierarchy information.

RFC3348 section 3 goes as far as stating that a client mustn't rely on LSUB
for hierarchy information.

This patch implements the LIST command extensions specified in RFC5258
requiring that a server must respond with hierarchy information for
listed folders (whether or not filtering on subscribed folders).

5 years agoAdd $imap_fetch_chunk_size to allow FETCHing new headers in chunks.
Kevin McCarthy [Sun, 19 Aug 2018 16:25:53 +0000 (09:25 -0700)]
Add $imap_fetch_chunk_size to allow FETCHing new headers in chunks.

For extremely large mailboxes, some implementations will time out just
while fetching the new headers, because the client doesn't send any
commands for 30 minutes while downloading the large number of headers.

Rewrite imap_fetch_msn_seqset() to return chunks of size
$imap_fetch_chunk_size.

The change requires trusting the server will follow the RFC and not
send an EXPUNGE during or between the FETCH chunks; otherwise we'll
miss MSNs between the chunks because the shift.

We could in theory continue to set "msn_begin = idata->max_msn + 1",
but that makes the assumption there are no holes in the header cache
that we are filling in during a chunk.  Personally I am dubious about
"header cache holes", but the IMAP code has explicitly mentioned and
handled them since prior to my involvement.

Since the RFC forbids the interleaving EXPUNGE I believe it's safe
enough to set "msn_begin = fetch_msn_end + 1" until proven otherwise.

5 years agoAdd note about $mailcap_path generation to the documentation.
Kevin McCarthy [Mon, 22 Apr 2019 18:02:28 +0000 (11:02 -0700)]
Add note about $mailcap_path generation to the documentation.

5 years agoConvert mutt_parse_adrlist() to use BUFFER for simple parsing.
Kevin McCarthy [Mon, 22 Apr 2019 03:05:13 +0000 (20:05 -0700)]
Convert mutt_parse_adrlist() to use BUFFER for simple parsing.

5 years agoChange mutt_parse_mailboxes() to use the path BUFFER argument.
Kevin McCarthy [Mon, 22 Apr 2019 02:45:49 +0000 (19:45 -0700)]
Change mutt_parse_mailboxes() to use the path BUFFER argument.

Instead of copying to a buf[] variable, since the various utility
methods are now available to BUFFER too.

5 years agoHandle the same secret key appearing in multiple public keyrings
Julian Gilbey [Thu, 18 Apr 2019 15:30:38 +0000 (16:30 +0100)]
Handle the same secret key appearing in multiple public keyrings

Allow for S/MIME keys and the possibility of missing subkeys

5 years agoFix unistring library configure test.
Kevin McCarthy [Sun, 21 Apr 2019 18:00:23 +0000 (11:00 -0700)]
Fix unistring library configure test.

The "action-if-found" argument of AC_SEARCH_LIBS is run even if the
result is "none required" (i.e. the test function is already in LIBS,
in this case -lidn2).

This was causing "-lunistring" to be appended on a system without the
library installed, generating a build error.  Fix the test to not
append the library for the "none required" case.

Thanks to Fabrice Fontaine for reporting this issue and helping me
test the fix.

5 years agoRevert "Fix truncation of long filenames in attachments."
Kevin McCarthy [Sat, 20 Apr 2019 22:43:59 +0000 (15:43 -0700)]
Revert "Fix truncation of long filenames in attachments."

This reverts commit f476d0aecd6f88db5291427fced21a8e834ca181.

The commit allowed the generation of illegal length header lines.  A
correct fix needs to implement parameter continuations.

I will work on that, but in case I don't get it in before 1.12,
preserve the hard truncation.

5 years agoConvert remailer to use BUFFER for Mixmaster invocation.
Kevin McCarthy [Sat, 20 Apr 2019 20:00:28 +0000 (13:00 -0700)]
Convert remailer to use BUFFER for Mixmaster invocation.

5 years agoConvert compress to use mutt_buffer_quote_filename().
Kevin McCarthy [Sat, 20 Apr 2019 19:34:35 +0000 (12:34 -0700)]
Convert compress to use mutt_buffer_quote_filename().

Because the compress expandos operate differently than the rest of
mutt, requiring manual outer quoting, add a parameter to the function
to toggle outer quoting off.

Remove the now unused escape_path() function.

5 years agoUpdate po headers.
Kevin McCarthy [Sat, 20 Apr 2019 18:11:07 +0000 (11:11 -0700)]
Update po headers.

Add missing Language header.

Make the Project-Id-Version header consistent.

5 years agoIncrease mutt_pgpring path size to silence warning.
Kevin McCarthy [Fri, 19 Apr 2019 23:06:43 +0000 (16:06 -0700)]
Increase mutt_pgpring path size to silence warning.

This is an independent binary, and doesn't have access to the BUFFER
functions.  The binary is used by very few (if any) people at this
point, so just make the minimum fix to silence the warning.

5 years agoConvert pager help string to use BUFFER.
Kevin McCarthy [Fri, 19 Apr 2019 22:04:43 +0000 (15:04 -0700)]
Convert pager help string to use BUFFER.

Remove the awkward string truncation warnings, and remove helpstr and
tmphelp char arrays from the stack.

Because the pager is fairly long lived, allocate the helpstr instead
of using the pool.

5 years agoConvert certficate prompts to use menu dialog helper and BUFFER.
Kevin McCarthy [Fri, 19 Apr 2019 21:25:05 +0000 (14:25 -0700)]
Convert certficate prompts to use menu dialog helper and BUFFER.

5 years agoAdd menu dialog helper to add rows.
Kevin McCarthy [Fri, 19 Apr 2019 20:14:54 +0000 (13:14 -0700)]
Add menu dialog helper to add rows.

Remove the manual max calculation and dialog row allocation.

Add a NONULL check because the helper uses safe_strdup() to add a row.

5 years agoConvert migrated lib.c functions to use BUFFER.
Kevin McCarthy [Fri, 19 Apr 2019 01:42:57 +0000 (18:42 -0700)]
Convert migrated lib.c functions to use BUFFER.

Fix mutt_getcwd() to return NULL on failure.

Change mutt_rmtree(), mutt_mkwrapdir(), safe_open(), and
safe_symlink() to use BUFFER so they don't have filename length
limitations.

5 years agoRelocate lib.c functions to muttlib.c to enable BUFFER use.
Kevin McCarthy [Thu, 18 Apr 2019 22:35:22 +0000 (15:35 -0700)]
Relocate lib.c functions to muttlib.c to enable BUFFER use.

Relocate safe_symlink(), safe_open(), mutt_rmtree() and their
dependent functions.

This rearrangement is a bit awkward.  Another approach for the future
might be to convert lib.c into a muttlib.c aware file, and just copy
the functions pgppubring.c uses inside itself.

5 years agoIncrease prompt size to remove warning.
Kevin McCarthy [Wed, 17 Apr 2019 23:07:05 +0000 (16:07 -0700)]
Increase prompt size to remove warning.

5 years agoConvert change folder operations to use BUFFER.
Kevin McCarthy [Wed, 17 Apr 2019 03:22:08 +0000 (20:22 -0700)]
Convert change folder operations to use BUFFER.

Store the folder name inside a BUFFER and use the various BUFFER
enhanced functions.

5 years agoAdd mutt_buffer_enter_fname().
Kevin McCarthy [Wed, 17 Apr 2019 02:25:36 +0000 (19:25 -0700)]
Add mutt_buffer_enter_fname().

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.