]> granicus.if.org Git - mutt/log
mutt
6 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 21 Dec 2018 03:52:20 +0000 (19:52 -0800)]
Merge branch 'stable'

6 years agoBackport postpone-encrypt cleanups from master.
Kevin McCarthy [Fri, 21 Dec 2018 03:39:39 +0000 (19:39 -0800)]
Backport postpone-encrypt cleanups from master.

Free the clear content after successfully postponing.

If the fcc fails, properly restore the clear content before returning
to the compose menu.

6 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 21 Dec 2018 02:54:25 +0000 (18:54 -0800)]
Merge branch 'stable'

6 years agoFix compilation without deprecated OpenSSL 1.1 APIs
Rosen Penev [Mon, 3 Dec 2018 00:46:28 +0000 (16:46 -0800)]
Fix compilation without deprecated OpenSSL 1.1 APIs

6 years agoFix flags if mutt_get_postponed() has no messages.
Kevin McCarthy [Thu, 20 Dec 2018 02:48:04 +0000 (18:48 -0800)]
Fix flags if mutt_get_postponed() has no messages.

Flags needs to be reset so memory cleanup is done at the end.

6 years agoMore postpone cleanup.
Kevin McCarthy [Thu, 20 Dec 2018 02:36:19 +0000 (18:36 -0800)]
More postpone cleanup.

Provide an error message if $postponed is not set.

Make sure the clear content is freed for encrypted messages.

If the write_fcc() fails, make sure to restore the clear content.

6 years agoWhen postponing, encode descriptions before encrypting.
Kevin McCarthy [Thu, 20 Dec 2018 01:43:26 +0000 (17:43 -0800)]
When postponing, encode descriptions before encrypting.

This matches the behavior of the normal send process.  I don't think
there is actually an issue here since nothing is sent, but it makes
sense to be consistent.

6 years agoRefactor postpone_message().
Kevin McCarthy [Thu, 20 Dec 2018 00:20:23 +0000 (16:20 -0800)]
Refactor postpone_message().

6 years agoPrompt when mutt_write_fcc() fails.
Kevin McCarthy [Wed, 19 Dec 2018 23:42:24 +0000 (15:42 -0800)]
Prompt when mutt_write_fcc() fails.

Allow the user to retry, specify an alternate mailbox, or skip.

6 years agoMove fcc after send.
Kevin McCarthy [Wed, 19 Dec 2018 22:35:22 +0000 (14:35 -0800)]
Move fcc after send.

6 years agoRefactor save_fcc() function.
Kevin McCarthy [Wed, 19 Dec 2018 22:24:46 +0000 (14:24 -0800)]
Refactor save_fcc() function.

6 years agoAdd rfc2047_encode_envelope helper.
Kevin McCarthy [Sun, 16 Dec 2018 22:23:54 +0000 (14:23 -0800)]
Add rfc2047_encode_envelope helper.

6 years agoAdd protected header received email support.
Kevin McCarthy [Tue, 11 Dec 2018 22:11:30 +0000 (14:11 -0800)]
Add protected header received email support.

Add $crypt_protected_headers_read config variable to enable reading
and updating the index/header cache.

Print protected Subject header in the pager as parts are rendered.

Once opened, update the index, subject hash, and header cache.

6 years agoAdd mx operation save_to_header_cache.
Kevin McCarthy [Sat, 15 Dec 2018 22:49:55 +0000 (14:49 -0800)]
Add mx operation save_to_header_cache.

This will be used when reading protected headers, to store the
encrypted subject in the header cache so it can be searched with.

6 years agoParse and store mime headers in the BODY.
Kevin McCarthy [Mon, 10 Dec 2018 01:41:58 +0000 (17:41 -0800)]
Parse and store mime headers in the BODY.

Don't store the field in the header cache though.

6 years agoFactor out rfc2047_decode_envelope().
Kevin McCarthy [Mon, 10 Dec 2018 03:52:21 +0000 (19:52 -0800)]
Factor out rfc2047_decode_envelope().

6 years agoMerge branch 'stable'
Kevin McCarthy [Thu, 13 Dec 2018 00:14:48 +0000 (16:14 -0800)]
Merge branch 'stable'

6 years agoFix imap_sync_mailbox() hcache leak.
Kevin McCarthy [Thu, 13 Dec 2018 00:10:23 +0000 (16:10 -0800)]
Fix imap_sync_mailbox() hcache leak.

Uploading changed messages to the server ends up overwriting the
hcache.  Add a straightforward fix and a longish explanation comment
for the stable branch fix.

Add a TODO noting a better fix should be done in the master branch in
the future.

6 years agoMerge branch 'stable'
Kevin McCarthy [Wed, 12 Dec 2018 20:41:53 +0000 (12:41 -0800)]
Merge branch 'stable'

6 years agoFix possible smime crash if the read mime header p is NULL.
Kevin McCarthy [Wed, 12 Dec 2018 02:41:37 +0000 (18:41 -0800)]
Fix possible smime crash if the read mime header p is NULL.

6 years agoFix memory leak in smime.c.
Kevin McCarthy [Tue, 11 Dec 2018 23:29:57 +0000 (15:29 -0800)]
Fix memory leak in smime.c.

smime_application_smime_handler() was not freeing the BODY returned by
smime_handle_entity().

6 years agoFix mutt_parse_rfc822_line() if lastp parameter is NULL.
Kevin McCarthy [Sun, 9 Dec 2018 20:32:24 +0000 (12:32 -0800)]
Fix mutt_parse_rfc822_line() if lastp parameter is NULL.

It checked at the beginning before dereferencing, but not at the end.

Since lastp is only used for the user_hdrs case, move the local
variable and assignment inside that block to make it clear.

6 years agoFix possible smime crash if the read mime header p is NULL.
Kevin McCarthy [Wed, 12 Dec 2018 02:41:37 +0000 (18:41 -0800)]
Fix possible smime crash if the read mime header p is NULL.

6 years agoFix memory leak in smime.c.
Kevin McCarthy [Tue, 11 Dec 2018 23:29:57 +0000 (15:29 -0800)]
Fix memory leak in smime.c.

smime_application_smime_handler() was not freeing the BODY returned by
smime_handle_entity().

6 years agoFix mutt_parse_rfc822_line() if lastp parameter is NULL.
Kevin McCarthy [Sun, 9 Dec 2018 20:32:24 +0000 (12:32 -0800)]
Fix mutt_parse_rfc822_line() if lastp parameter is NULL.

It checked at the beginning before dereferencing, but not at the end.

Since lastp is only used for the user_hdrs case, move the local
variable and assignment inside that block to make it clear.

6 years agoAdd $auto_subscribe variable.
Kevin McCarthy [Sat, 8 Dec 2018 23:15:56 +0000 (15:15 -0800)]
Add $auto_subscribe variable.

When set, it automatically subscribes to mailing lists found in
List-Post headers.

This commit is based on Michael Elkins's patch from the thread
<https://marc.info/?l=mutt-users&m=127076105423565&w=2>.

I've added an opt-in variable $auto_subscribe and a hash table cache
to speed up reading headers when the variable is set.

6 years agoAdd note about the second --with-fingerprint to gpg.rc.
Kevin McCarthy [Fri, 7 Dec 2018 21:18:04 +0000 (13:18 -0800)]
Add note about the second --with-fingerprint to gpg.rc.

6 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 7 Dec 2018 03:29:22 +0000 (19:29 -0800)]
Merge branch 'stable'

6 years agoFix classic gpg date parsing in list-keys.
Kevin McCarthy [Fri, 7 Dec 2018 03:22:59 +0000 (19:22 -0800)]
Fix classic gpg date parsing in list-keys.

GnuPG changed the format of their --with-colons output in 2.0.10.
Dates are now seconds since epoch.  Update the parse_pub_line() code
to detect the new format.

The GnuPG changes also separated pub and the first uid.  Since mutt
allows an empty uid field, the output is a bit less friendly now, with
an initial key without an uid.  I think that's acceptable, but
eventually we'll want to change the parsing behavior.

6 years agoUpdated French translation.
Vincent Lefevre [Thu, 6 Dec 2018 12:08:29 +0000 (13:08 +0100)]
Updated French translation.

6 years agoAdjust version number comment in gpgme.
Kevin McCarthy [Wed, 5 Dec 2018 17:31:34 +0000 (09:31 -0800)]
Adjust version number comment in gpgme.

6 years agoImprove the console output for extract-keys and speed up import.
Werner Koch [Mon, 3 Dec 2018 07:41:56 +0000 (08:41 +0100)]
Improve the console output for extract-keys and speed up import.

The listing of imported keys to the console must have stopped working
on 2014-12-31 due to a fix for bug #3698, commit
bbc5acb6de0ca56d7e8366402d68a1a919ca9b23 which was needed due to a
not fully working stub code introduced in 2008 with commit
a4b3a60dd63bc7af7927025b2d1344530ca89aa9.

The latter commit also introduced a bug in the import code which
listed all keys in the keyring to a temporary file and copied that one
to stdout.  The former commit avoided the output to stdout.

The fix here is to use pgp_gpgme_extract_keys only for extracting
information about the key and don't re-use the same code for importing
keys.  We now import the keys directly in pgp_gpgme_invoke_import and
we print the fingerprint and status flags for all imported keys.  That
information available from GPGME for ages (0.3.1 from 2003).
The user id is unfortunately not printed; that would require a lookup
of the newly imported key.  Can be done with another patch.

6 years agoTry to avoid creation of temp. directory for key import.
Werner Koch [Mon, 3 Dec 2018 07:41:55 +0000 (08:41 +0100)]
Try to avoid creation of temp. directory for key import.

Since gpgme 1.9.0 it is possible to list keys directly from a file
without importing it into gpg' own keyring.  This patch implements
this in a backward compatible way.

Unfortunately we need to check for a suitable gpgme version at build
time and also for a suitable gpg version at runtime.  This is
implemented by a version check which requires to call or include code
taken from libgpg-error (aka gpgrt).  However this library is anyway a
dependency of gpgme and thus does not pose any extra burden.

The functions parse_version_number, parse_version_string, and
cmp_version_strings are taken from libgpg-error's repo at 2018-11-20.
Libgpg-error is distributed under the LGPL-2.1-or-later.

6 years agoAlways use the gpgme_new wrapper in crypt-gpgme.
Werner Koch [Mon, 3 Dec 2018 07:41:54 +0000 (08:41 +0100)]
Always use the gpgme_new wrapper in crypt-gpgme.

The wrapper is much more convenient and there is no need to sometimes
use gpgme_new directly.  The perceived advantage on not bailing out in
an out-of-core condition is not realistic because other small amounts
of memory are allocated all over mutt anyway and thus function will
terminate the process as well.

This patch also changes the minimum version of gpgme to 1.4.0.  This
is so that we can always pass NULL to functions like gpgme_release.
Further 1.4.0 has new functions which we may soon like to use.

6 years agoRequire GPGME version 1.2.0 and drop useless HAVE macros.
Werner Koch [Mon, 3 Dec 2018 07:41:53 +0000 (08:41 +0100)]
Require GPGME version 1.2.0 and drop useless HAVE macros.

GPGME 1.2.0 was released nearly 10 years ago and thus we can really
demand this version.  For various reasons it would be advisable to
require a decent version but that is a different thing and needs to be
done in a separate patch.

HAVE_GPGME_OP_EXPORT_KEYS and HAVE_GPGME_PKA_TRUST are not anymore
needed because they are supported by that GPGME version.

Signed-off-by: Werner Koch <wk@gnupg.org>
6 years agoNuke trailing white space from the crypt-* files.
Werner Koch [Mon, 3 Dec 2018 07:41:52 +0000 (08:41 +0100)]
Nuke trailing white space from the crypt-* files.

6 years agoImprove rfc2047_decode to deal with improperly split words.
Kevin McCarthy [Mon, 3 Dec 2018 05:39:55 +0000 (21:39 -0800)]
Improve rfc2047_decode to deal with improperly split words.

Some non-compliant MUAs split rfc2047 words inside a multibyte
character.

Deal with this by accumulating decoded words sharing the same
character set, and then perform character conversion all at once.

It is not clear to me that the $ignore_linear_white_space option is
functional or properly coded, but I've gone through the effort of
trying to preserve its calls.

6 years agoConvert rfc2047_decode() to use buffers.
Kevin McCarthy [Sun, 25 Nov 2018 05:03:26 +0000 (21:03 -0800)]
Convert rfc2047_decode() to use buffers.

Rework the loop so it's centered on the find_encoded_word() call.

It appears only the last text chunk was run through character
conversion with AssumedCharset.  I've changed it to run for each text
chunk.

6 years agoAdd mutt_buffer_addstr_n().
Kevin McCarthy [Mon, 3 Dec 2018 04:26:27 +0000 (20:26 -0800)]
Add mutt_buffer_addstr_n().

6 years agoMerge branch 'stable'
Kevin McCarthy [Mon, 3 Dec 2018 15:47:17 +0000 (07:47 -0800)]
Merge branch 'stable'

6 years agoFix typo in Finnish translation.
Kevin McCarthy [Mon, 3 Dec 2018 15:30:34 +0000 (07:30 -0800)]
Fix typo in Finnish translation.

Thanks to @Petteri3 for the patch.

6 years agoFix typo in Finnish translation.
Kevin McCarthy [Mon, 3 Dec 2018 15:30:34 +0000 (07:30 -0800)]
Fix typo in Finnish translation.

Thanks to @Petteri3 for the patch.

6 years agoAdded configure.lineno to .gitignore as this file is left by configure:
Vincent Lefevre [Mon, 3 Dec 2018 14:55:53 +0000 (15:55 +0100)]
Added configure.lineno to .gitignore as this file is left by configure:
https://lists.gnu.org/archive/html/autoconf/2004-01/msg00034.html

6 years agoFix next release number in UPDATING file.
Kevin McCarthy [Mon, 3 Dec 2018 02:38:03 +0000 (18:38 -0800)]
Fix next release number in UPDATING file.

6 years agoFix compilation without deprecated OpenSSL 1.1 APIs
Rosen Penev [Mon, 3 Dec 2018 00:46:28 +0000 (16:46 -0800)]
Fix compilation without deprecated OpenSSL 1.1 APIs

6 years agoEnhance docs re security of SSL/TLS version vars
Sam Pablo Kuper [Sun, 2 Dec 2018 22:32:35 +0000 (22:32 +0000)]
Enhance docs re security of SSL/TLS version vars

6 years agoDeprecate TLS 1.0 and 1.1 by default
Sam Pablo Kuper [Sun, 2 Dec 2018 22:31:19 +0000 (22:31 +0000)]
Deprecate TLS 1.0 and 1.1 by default

Fixes #101.

Minor digit of version number has been bumped per [Semantic Versioning
2.0.0](https://semver.org/spec/v2.0.0.html) §7:

> Minor version Y (x.Y.z | x > 0) MUST be incremented if ... any public
> API functionality is marked as deprecated.

6 years agoMerge branch 'stable'
Kevin McCarthy [Sat, 1 Dec 2018 19:46:03 +0000 (11:46 -0800)]
Merge branch 'stable'

6 years agoautomatic post-release commit for mutt-1.11.1 mutt-1-11-1-rel
Kevin McCarthy [Sat, 1 Dec 2018 19:38:36 +0000 (11:38 -0800)]
automatic post-release commit for mutt-1.11.1

6 years agoDocument Sender header as a default in $imap_headers.
Kevin McCarthy [Sat, 1 Dec 2018 19:27:20 +0000 (11:27 -0800)]
Document Sender header as a default in $imap_headers.

6 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.

6 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 30 Nov 2018 23:03:11 +0000 (15:03 -0800)]
Merge branch 'stable'

6 years agoAdd SENDER to default list of IMAP headers.
Kevin McCarthy [Thu, 29 Nov 2018 20:36:08 +0000 (12:36 -0800)]
Add SENDER to default list of IMAP headers.

This header is matched by the ~e and ~L patterns.  Those patterns
should work without the user having to know to add Sender to the list
of $imap_headers.  This was probably just an oversight.

6 years agoUpdated Polish translation.
Adam Golebiowski [Tue, 27 Nov 2018 23:19:38 +0000 (00:19 +0100)]
Updated Polish translation.

6 years agoAdd SENDER to default list of IMAP headers.
Kevin McCarthy [Thu, 29 Nov 2018 20:36:08 +0000 (12:36 -0800)]
Add SENDER to default list of IMAP headers.

This header is matched by the ~e and ~L patterns.  Those patterns
should work without the user having to know to add Sender to the list
of $imap_headers.  This was probably just an oversight.

6 years agoUpdated French translation.
Vincent Lefevre [Wed, 28 Nov 2018 11:27:44 +0000 (12:27 +0100)]
Updated French translation.

6 years agoImprove pgp error message for translation.
Kevin McCarthy [Wed, 28 Nov 2018 03:06:42 +0000 (19:06 -0800)]
Improve pgp error message for translation.

The past tense phrase makes it unclear whether the error is about a
failed action or the state of the message.

Thanks to Vincent Lefèvre for the improved wording suggestion.

6 years agoUpdated Polish translation.
Adam Golebiowski [Tue, 27 Nov 2018 23:19:38 +0000 (00:19 +0100)]
Updated Polish translation.

6 years agoMerge branch 'stable'
Kevin McCarthy [Tue, 27 Nov 2018 22:05:10 +0000 (14:05 -0800)]
Merge branch 'stable'

6 years agoFix QRESYNC crash after a large number of VANISHED messages.
Kevin McCarthy [Tue, 27 Nov 2018 21:55:04 +0000 (13:55 -0800)]
Fix QRESYNC crash after a large number of VANISHED messages.

When handling QRESYNC vanished, imap_expunge_mailbox() was called to
empty out the messages.  Various counters, including vcount are
updated by the mx_update_tables() after the expunge.

These counters need to be reset, because mx_update_context() will do
so once again at the end of reading new headers.  This can cause an
out of bounds access in v2r.

6 years agoPrevent trying to match a failing color body regex repeatedly.
Kevin McCarthy [Mon, 26 Nov 2018 03:48:49 +0000 (19:48 -0800)]
Prevent trying to match a failing color body regex repeatedly.

Emails with really long lines (e.g. spam), can suffer performance if a
complicated regex is matched to no effect over and over.  If the regex
failed at the beginning, it won't match at the end of another's regex
match range, so turn it off.

6 years agoSwitch color chunk matching to use bsearch.
Kevin McCarthy [Mon, 19 Nov 2018 03:13:20 +0000 (19:13 -0800)]
Switch color chunk matching to use bsearch.

Emails with extremely long lines, combined with a large number of
color matches, can cause a performance hit so severe that mutt appears
to have hung.

Switching out to using a binary search speeds things up noticably.

The for loops being replaced were a bit strange.  resolve_types()
ensures there are no overlaps, and that they are ordered.  A match is
defined by (first <= cnt < last).  I can't see any reason for the
strange comparison of (cnt > last) follow by (cnt != last).  Perhaps
at one time it made sense.

6 years agoautomatic post-release commit for mutt-1.11.0 mutt-1-11-rel
Kevin McCarthy [Sun, 25 Nov 2018 17:50:23 +0000 (09:50 -0800)]
automatic post-release commit for mutt-1.11.0

6 years agoBump release date.
Kevin McCarthy [Sun, 25 Nov 2018 17:33:53 +0000 (09:33 -0800)]
Bump release date.

6 years agoUpdated Danish translation.
Morten Bo Johansen [Sat, 24 Nov 2018 18:10:24 +0000 (10:10 -0800)]
Updated Danish translation.

6 years agoUpdated Russian translation.
Vsevolod Volkov [Sat, 24 Nov 2018 18:06:55 +0000 (10:06 -0800)]
Updated Russian translation.

6 years agoUpdated Ukrainian translation.
Vsevolod Volkov [Sat, 24 Nov 2018 18:04:00 +0000 (10:04 -0800)]
Updated Ukrainian translation.

6 years agoUpdate de.po
Olaf Hering [Fri, 23 Nov 2018 08:05:49 +0000 (09:05 +0100)]
Update de.po

Unwrap lines, because it is almost 2019.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
6 years agoUpdated Japanese translation.
TAKAHASHI Tamotsu [Thu, 22 Nov 2018 17:10:48 +0000 (09:10 -0800)]
Updated Japanese translation.

6 years agoAdd L10N comments to several unclear messages.
TAKAHASHI Tamotsu [Sun, 18 Nov 2018 18:05:30 +0000 (10:05 -0800)]
Add L10N comments to several unclear messages.

Updating Japanese translation, I found that some of the updated messages
were a little hard to understand without reading the code.

Add comments to some messages I nearly translated in a wrong way.

6 years agoCzech translation update for Mutt 1.11.0
Petr Písař [Sat, 17 Nov 2018 13:55:58 +0000 (14:55 +0100)]
Czech translation update for Mutt 1.11.0

6 years agoUpdated fr.po for Mutt 1.11.0.
Vincent Lefevre [Sat, 17 Nov 2018 01:28:01 +0000 (02:28 +0100)]
Updated fr.po for Mutt 1.11.0.

6 years agoMinor fixes to UPDATING.
Kevin McCarthy [Thu, 15 Nov 2018 17:29:15 +0000 (09:29 -0800)]
Minor fixes to UPDATING.

6 years agoUpdate $index_format cross-references in manual.
Kevin McCarthy [Wed, 14 Nov 2018 22:13:47 +0000 (14:13 -0800)]
Update $index_format cross-references in manual.

Add index-format-hook to the list of hooks.

Add the list of configuration variables that use the expandos.

Add a note to $post_index_string that it uses the expandos.

6 years agoUpdate the UPDATING file for 1.11.0 release.
Kevin McCarthy [Tue, 13 Nov 2018 23:01:53 +0000 (15:01 -0800)]
Update the UPDATING file for 1.11.0 release.

6 years agoUpdated Simplified Chinese translation.
lilydjwg [Sat, 10 Nov 2018 14:51:34 +0000 (06:51 -0800)]
Updated Simplified Chinese translation.

6 years agoMinor edits to the README.
Kevin McCarthy [Wed, 7 Nov 2018 22:19:25 +0000 (14:19 -0800)]
Minor edits to the README.

6 years agoAdd some brief documentation on OAUTH support.
Kevin McCarthy [Wed, 7 Nov 2018 21:38:53 +0000 (13:38 -0800)]
Add some brief documentation on OAUTH support.

These are just pulled from Brandon's commit message.

6 years agoAdd monitor.h to extra_sources list.
Kevin McCarthy [Tue, 6 Nov 2018 23:54:45 +0000 (15:54 -0800)]
Add monitor.h to extra_sources list.

6 years agoAllow relative date hour/min/sec offsets.
Kevin McCarthy [Tue, 6 Nov 2018 21:21:20 +0000 (13:21 -0800)]
Allow relative date hour/min/sec offsets.

These might be useful for index-format-hook pattern matching for some
people.

6 years agoFix a few memory leaks for idna conversion.
Kevin McCarthy [Tue, 6 Nov 2018 19:02:01 +0000 (11:02 -0800)]
Fix a few memory leaks for idna conversion.

6 years agoDocument send-hooks are not executed for resumed messages.
Kevin McCarthy [Tue, 6 Nov 2018 01:44:20 +0000 (17:44 -0800)]
Document send-hooks are not executed for resumed messages.

6 years agoPrevent $charset from having multiple values.
Kevin McCarthy [Tue, 6 Nov 2018 00:19:03 +0000 (16:19 -0800)]
Prevent $charset from having multiple values.

Mutt relies on it being a single character set, but failed to make
sure of that in check_charset().

Thanks to Hans-Peter Jansen for reporting the problem, and to Mel
Gorman for working with me to track down the issue in his
configuration.

6 years agoAlways print mutt_buffer_pool_free() size debug output.
Kevin McCarthy [Wed, 31 Oct 2018 19:19:56 +0000 (12:19 -0700)]
Always print mutt_buffer_pool_free() size debug output.

So I can easily see the resulting size of the pool at the end of a
run.

6 years agoAdd a flag for dynamic date range evaluation in patterns.
Kevin McCarthy [Tue, 30 Oct 2018 18:53:37 +0000 (11:53 -0700)]
Add a flag for dynamic date range evaluation in patterns.

By default, Mutt evaluates relative date patterns, such as "~d<1d"
against the date when the pattern is compiled.

For index-format-hook, we need to pattern match against a message
based on the current date/time, so that for example, conditional date
format patterns correctly match after Mutt has been open for many
days/weeks.

Add a flag, MUTT_PATTERN_DYNAMIC, that changes ~d and ~r evaluation to
reevaluate the min/max range with each match.

This will of course be slower, but for the index, where a screenful of
messages at a time are evaluated, is an acceptable tradeoff against
accurate pattern matching.

6 years agoAdd index-format-hook and expando.
Kevin McCarthy [Mon, 29 Oct 2018 20:45:02 +0000 (13:45 -0700)]
Add index-format-hook and expando.

index-format-hook is used to allow dynamic insertion/evaluation of
format strings into $index_format.

It can be used, for example, to implement date formatting based on the
age of the message.

Add a new %@name@ expando to $index_format, which evaluates the
matching index-format-hooks with "name".

6 years agoFix memory leak on error in eat_regexp() and eat_date().
Kevin McCarthy [Tue, 30 Oct 2018 15:55:52 +0000 (08:55 -0700)]
Fix memory leak on error in eat_regexp() and eat_date().

6 years agoFix memleaks of saslconn on error paths
Peter Wu [Tue, 23 Oct 2018 10:29:26 +0000 (12:29 +0200)]
Fix memleaks of saslconn on error paths

If mutt_sasl_client_new returns an error, the callers would ignore the
allocated saslconn resource from sasl_client_new. Be sure to release
these with sasl_dispose as documented in sasl.h. Likewise, let callers
(POP/IMAP) dispose the resource on their error paths. SMTP was already
taken care of. Found with LeakSanitizer in IMAP.

6 years agoMinor syntactic cleanup in mutt_print_attachment().
Kevin McCarthy [Wed, 17 Oct 2018 00:42:35 +0000 (17:42 -0700)]
Minor syntactic cleanup in mutt_print_attachment().

Converting a return to a rc assignment accidentally left an extra
parenthesis.

6 years agoEnsure a resized empty buffer is null-terminated.
Kevin McCarthy [Wed, 17 Oct 2018 00:35:54 +0000 (17:35 -0700)]
Ensure a resized empty buffer is null-terminated.

The new buffer code is using the pool, which ensures its buffers are
null-terminated.

However, if a "new" buffer from another part of the code were passed
to one of the temporary interfaces that resizes the buffer, it's
possible a non-terminated string might end up being passed through.

It's reasonable to expect mutt_b2s() for a "new" buffer should be the
same as after it is resized larger.  So ensure the resulting buf->data
is properly terminated to avoid surprises.

6 years agoRemove conversion of nbsp to space.
Kevin McCarthy [Tue, 16 Oct 2018 23:04:57 +0000 (16:04 -0700)]
Remove conversion of nbsp to space.

Keep the behavior of it not line-breaking, but don't change it to a
space character when displaying.  This is so copy-paste from the pager
will preserve the nbsp, which is semantically important in some
locales.

6 years agoConvert mutt_print_attachment to use BUFFER.
Kevin McCarthy [Sun, 14 Oct 2018 21:35:21 +0000 (14:35 -0700)]
Convert mutt_print_attachment to use BUFFER.

6 years agoConvert mutt_view_attachment to use BUFFER.
Kevin McCarthy [Sun, 14 Oct 2018 21:02:20 +0000 (14:02 -0700)]
Convert mutt_view_attachment to use BUFFER.

6 years agoConvert mutt_edit_attachment to use BUFFER.
Kevin McCarthy [Sun, 14 Oct 2018 20:02:20 +0000 (13:02 -0700)]
Convert mutt_edit_attachment to use BUFFER.

6 years agoConvert mutt_compose_attachment to use BUFFER.
Kevin McCarthy [Sun, 14 Oct 2018 23:18:53 +0000 (16:18 -0700)]
Convert mutt_compose_attachment to use BUFFER.

6 years agoConvert mutt_get_tmp_attachment to use BUFFER.
Kevin McCarthy [Sun, 14 Oct 2018 19:52:30 +0000 (12:52 -0700)]
Convert mutt_get_tmp_attachment to use BUFFER.

6 years agoAdd mutt_buffer_adv_mktemp() transition function.
Kevin McCarthy [Mon, 15 Oct 2018 02:02:47 +0000 (19:02 -0700)]
Add mutt_buffer_adv_mktemp() transition function.

6 years agoAdd mutt_buffer_mktemp() transition function.
Kevin McCarthy [Mon, 15 Oct 2018 01:36:08 +0000 (18:36 -0700)]
Add mutt_buffer_mktemp() transition function.

This is self-contained and easy to translate, so instead just create
an alternate implementation using BUFFER.

6 years agoAdd rfc1524 buffer function interfaces for attach.c conversion.
Kevin McCarthy [Sun, 14 Oct 2018 22:48:07 +0000 (15:48 -0700)]
Add rfc1524 buffer function interfaces for attach.c conversion.

The rfc1524 functions call, and are called by, many functions that
need to be converted.  But to keep the conversion manageable, install
helper interface functions that pass the buffer->data and
buffer->dsize in and adjust the buffer->dptr afterwards.

6 years agoConvert the rest of mh.c to use BUFFER for file paths.
Kevin McCarthy [Wed, 10 Oct 2018 20:08:27 +0000 (13:08 -0700)]
Convert the rest of mh.c to use BUFFER for file paths.

  * mh_read_sequences
  * mh_sequences_changed
  * mh_already_notified
  * mh_mkstemp
  * mh_update_sequences
  * mh_sequences_add_one
  * maildir_update_time
  * maildir_delayed_parsing
  * maildir_open_mailbox_append
  * mh_open_mailbox_append
  * maildir_mh_open_message
  * maildir_open_new_message
  * _mh_commit_message
  * mh_rewrite_message
  * mh_sync_mailbox
  * mh_check_mailbox
  * maildir_check_empty
  * mx_is_maildir
  * mx_is_mh()