]> granicus.if.org Git - mutt/log
mutt
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()

6 years agoAdd a comment about gnutls date bits in certstat.
Kevin McCarthy [Wed, 10 Oct 2018 19:50:15 +0000 (12:50 -0700)]
Add a comment about gnutls date bits in certstat.

It's easy to miss the call disabling date checking and wonder why the
certstat bits are not set.

6 years agoChange gnutls certificate_file processing and interactive prompts.
Kevin McCarthy [Tue, 9 Oct 2018 21:39:09 +0000 (14:39 -0700)]
Change gnutls certificate_file processing and interactive prompts.

Accept a saved cert at any point in the chain, except for those
revoked or with invalid dates.

The INSECUREALG processing was a bit goofed up.  It was skipping the
prompt for every chain except the host, and was only displaying an
error for entry 1 (the host being 0, root being len-1).  Instead
prompt at any point, and display a warning as with the other errors.

Add a CERTERR_OTHER type to capture other bits.  Recently GnuTLS has
added additional certificate_status_t types.  We may want to improve
the prompts in the future for those, but for now at least make sure
it's recorded in certerr.

6 years agoFix gnutls (a)lways to properly save for all certerr values.
Kevin McCarthy [Tue, 9 Oct 2018 20:28:15 +0000 (13:28 -0700)]
Fix gnutls (a)lways to properly save for all certerr values.

For the case of SIGNERNOTCA, INSECUREALG, or a newer unhandled value,
the "(a)ccept always" prompt was allowed, but the cert saving was
prevented by a check only against NOTTRUSTED.  This ended up giving a
strange error message saying the cert was not saved.

Fix to save the cert for all errors except HOSTNAME (which is handled
separately).

6 years agoConvert maildir_canon_filename() and callers to use BUFFER.
Kevin McCarthy [Mon, 8 Oct 2018 02:08:42 +0000 (19:08 -0700)]
Convert maildir_canon_filename() and callers to use BUFFER.

Callers are maildir_check_mailbox(), _maildir_open_find_message(), and
maildir_open_find_message().

6 years agoConvert maildir_sync_message to use BUFFERs.
Kevin McCarthy [Sun, 7 Oct 2018 23:17:36 +0000 (16:17 -0700)]
Convert maildir_sync_message to use BUFFERs.

6 years agoConvert _maildir_commit_message to use BUFFER.
Kevin McCarthy [Sun, 7 Oct 2018 22:48:17 +0000 (15:48 -0700)]
Convert _maildir_commit_message to use BUFFER.

6 years agoConvert maildir_parse_dir to use BUFFER.
Kevin McCarthy [Sun, 7 Oct 2018 22:31:40 +0000 (15:31 -0700)]
Convert maildir_parse_dir to use BUFFER.

Note: the uses of buf and tmp don't overlap, so we only use a single
BUFFER.

6 years agoConvert buffy_maildir_check_dir to use BUFFER.
Kevin McCarthy [Sun, 7 Oct 2018 22:18:34 +0000 (15:18 -0700)]
Convert buffy_maildir_check_dir to use BUFFER.

6 years agoConvert mix_send_message to use buffer pool.
Kevin McCarthy [Mon, 8 Oct 2018 17:36:13 +0000 (10:36 -0700)]
Convert mix_send_message to use buffer pool.

6 years agoCreate mutt_buffer_add_printf().
Kevin McCarthy [Mon, 8 Oct 2018 17:48:29 +0000 (10:48 -0700)]
Create mutt_buffer_add_printf().

Change mutt_buffer_printf() to overwrite the buffer contents, like
mutt_buffer_strcpy().

mutt_buffer_add*() functions append to the buffer contents.

6 years agoConvert imap_rename and pgp_invoke_list_keys to use buffer pool.
Kevin McCarthy [Sat, 6 Oct 2018 22:07:27 +0000 (15:07 -0700)]
Convert imap_rename and pgp_invoke_list_keys to use buffer pool.

6 years agoAdd buffer pool functions.
Kevin McCarthy [Sat, 6 Oct 2018 20:53:33 +0000 (13:53 -0700)]
Add buffer pool functions.

Also add a few helper functions: mutt_buffer_clear(),
mutt_buffer_strcpy(), and a macro mutt_b2s to grab the buffer data as
a const char *.

6 years agoRearrange and clean up buffer functions.
Kevin McCarthy [Sat, 6 Oct 2018 20:08:13 +0000 (13:08 -0700)]
Rearrange and clean up buffer functions.

6 years agoBreak buffer functions into separate source file.
Kevin McCarthy [Sat, 6 Oct 2018 19:43:17 +0000 (12:43 -0700)]
Break buffer functions into separate source file.

6 years agoImprove info install/uninstall checks.
Kevin McCarthy [Fri, 5 Oct 2018 17:04:27 +0000 (10:04 -0700)]
Improve info install/uninstall checks.

Make sure install-info exists before using it.

Make sure target mutt.info exists before calling `install-info
--delete`.  Add a few missing '-f' force flags to removals during
uninstall.

6 years agoBuild info file documentation.
Kevin McCarthy [Thu, 4 Oct 2018 19:06:27 +0000 (12:06 -0700)]
Build info file documentation.

If docbook2x-texi and makeinfo are installed, convert the docbook file
to info and install as another source for the manual.

6 years agoAdapt translation of "Subject" in help text
Max Görner [Wed, 3 Oct 2018 20:36:32 +0000 (22:36 +0200)]
Adapt translation of "Subject" in help text

In the help text, "Subject" was not translated. Since it is translated
by "Betreff" at other locations, this was adapted.

6 years agoTranslate ERROR by FEHLER
Max Görner [Wed, 3 Oct 2018 20:32:44 +0000 (22:32 +0200)]
Translate ERROR by FEHLER

6 years agoAdd several "Durchkopplungsbindestrich" to some German translations
Max Görner [Wed, 3 Oct 2018 20:28:57 +0000 (22:28 +0200)]
Add several "Durchkopplungsbindestrich" to some German translations

While up to personal taste to a certain extent, in general it is more
appropriate to use dashes instead of spaces to to combine related but
distinct terms.

This commit introduces dashes, so called Durchkopplungsbindestriche, to
some of the terms, were found more suiting.

6 years agoFix typos in German translation
Max Görner [Wed, 3 Oct 2018 20:20:30 +0000 (22:20 +0200)]
Fix typos in German translation

There were some typos in the German translation. Those found by a brief
inspection are fixed now.

6 years agoConvert pgp_invoke_list_keys and mix_send_message to use BUFFERs.
Kevin McCarthy [Fri, 28 Sep 2018 22:08:19 +0000 (15:08 -0700)]
Convert pgp_invoke_list_keys and mix_send_message to use BUFFERs.

Both repetitively perform a lot of copying back in forth, which is
much cleaner with a BUFFER.

Note that in pgp_invoke_list_keys, if there are no hints uids->data
would be NULL.  However, the pgp_invoke() checks and wraps all the
format substitutions with NONULL.

6 years agoChange imap_rename_mailbox to use a BUFFER.
Kevin McCarthy [Fri, 28 Sep 2018 21:22:09 +0000 (14:22 -0700)]
Change imap_rename_mailbox to use a BUFFER.

6 years agoIncrease buffer sizes for some IMAP commands.
Kevin McCarthy [Fri, 28 Sep 2018 00:29:16 +0000 (17:29 -0700)]
Increase buffer sizes for some IMAP commands.

Use to ensure assembled IMAP commands fit in the resultant buffer to
be imap_exec()'ed.

RFC2683 suggested a limit of 1000, but asked servers to accept up to
8000.  Furthermore, RFC7162 bumped the client limit suggestion up to
8192.  So I don't believe any issues will be caused by this.

Most of these are increases are just to remove theoretical truncation
warned about by the compiler; I don't believe we've had reports of
actual command truncation due to a mailbox 1024 characters long.

6 years agoAdd regfree to configure regex test.
Kevin McCarthy [Thu, 27 Sep 2018 22:03:40 +0000 (15:03 -0700)]
Add regfree to configure regex test.

This allows to run the system regex lib even when compiling with
ASAN.  Previously, ASAN would report the regex_t leak and change the
exit code.

6 years agoFix non-threaded $sort_aux "reverse-" sorting.
Kevin McCarthy [Wed, 26 Sep 2018 02:03:56 +0000 (19:03 -0700)]
Fix non-threaded $sort_aux "reverse-" sorting.

The secondary sort was looking at (Sort & SORT_REVERSE) instead
of (SortAux & SORT_REVERSE), so wasn't even performing the reverse
based on the correct flag.

Additionally, afterwards, the primary sort was improperly applying a
reverse when the secondary sort returned non-zero.

Change SORTCODE() to look at SortAux when we are inside a secondary
sort.

Change AUXSORT() to return the result if the secondary sort returns
non-zero.  It is ugly to put a return inside the macro, but the check
for non-zero needs to be performed inside the AUXSORT if branch.

If the secondary sort returns 0, then the primary sort can still
compare index and apply a reverse as needed.

6 years agoMerge branch 'stable'
Kevin McCarthy [Sat, 22 Sep 2018 16:57:30 +0000 (09:57 -0700)]
Merge branch 'stable'

6 years agoIncrease user/pass field sizes in auth_login.
Kevin McCarthy [Sat, 22 Sep 2018 16:53:55 +0000 (09:53 -0700)]
Increase user/pass field sizes in auth_login.

account.pass was previously increased to 256 in cd421c13.  Also, the
buf should be bigger than the user+pass+"LOGIN", so bump it up too.

6 years agoAdd output during smime_keys purpose flag checking.
Kevin McCarthy [Sat, 22 Sep 2018 00:13:02 +0000 (17:13 -0700)]
Add output during smime_keys purpose flag checking.

6 years agoSend imap keepalives for interactive filters.
Kevin McCarthy [Tue, 18 Sep 2018 02:40:22 +0000 (19:40 -0700)]
Send imap keepalives for interactive filters.

When viewing attachments externally with a (non-copiousoutput) mailcap
entry missing %s, the command is invoked as a filter, with the
attachment piped into stdin.  However, unlike a filter, the user
interacts with the command, instead of just displaying the output in
the pager.

Just as with the mutt_system() command, Mutt needs to send imap
keepalives to keep those connections from closing during the
potentially extended invocation.

Thanks to John Hawkinson for the bug report, and his suggested patch,
which this commit is based upon.

6 years agoRemove purpose checks in smime_keys.pl verify step.
Kevin McCarthy [Fri, 14 Sep 2018 21:23:04 +0000 (14:23 -0700)]
Remove purpose checks in smime_keys.pl verify step.

The purpose checks are subsequently performed, and added as a field to
the .index.  In any case, it turns out passing multiple '-purpose'
arguments isn't even correct: openssl appears to just use the last
one.

Thanks to David J. Weller-Fahy for reporting the problem, and for
including a possible patch.

6 years agoFree queries and alias_queries before exiting.
Kevin McCarthy [Fri, 14 Sep 2018 21:21:04 +0000 (14:21 -0700)]
Free queries and alias_queries before exiting.

6 years agoChange imap_conn_find() to always return an authenticated conn.
Kevin McCarthy [Thu, 13 Sep 2018 01:23:00 +0000 (18:23 -0700)]
Change imap_conn_find() to always return an authenticated conn.

With the flag MUTT_IMAP_CONN_NONEW, it was already ensured the
connection would be authenticated.  However, without that flag, an
error in opening the connection or authentication would still return
an idata.

The callers that didn't bother to check the state were still assuming
authenticated, because they were all subseqeuently issuing an
"authenticated state" command to the server.

Rather than add state checks to every caller, just change the function
to return NULL if the idata did not end up in an authenticated state.

Remove the now redundant state checks in imap_open_mailbox() and
imap_get_mailbox().

6 years agoChange compress examples to type "example" rather than "sect4".
Kevin McCarthy [Sun, 2 Sep 2018 21:43:04 +0000 (14:43 -0700)]
Change compress examples to type "example" rather than "sect4".

6 years agoClean up documentation link targets.
Kevin McCarthy [Sun, 2 Sep 2018 21:22:09 +0000 (14:22 -0700)]
Clean up documentation link targets.

Move link targets for iconv-hook and sidebar_whitelist to the
beginning of a section, rather than a link embedded inside a command.

6 years agoUpdated French translation.
Vincent Lefevre [Sun, 2 Sep 2018 18:53:41 +0000 (20:53 +0200)]
Updated French translation.

6 years agoFix typo
Cody Brownstein [Sat, 1 Sep 2018 16:47:07 +0000 (09:47 -0700)]
Fix typo

6 years agoConvert certificate prompts to show sha-256 instead of md5.
Kevin McCarthy [Fri, 31 Aug 2018 22:50:00 +0000 (15:50 -0700)]
Convert certificate prompts to show sha-256 instead of md5.

Due to the length of the sha-256 fingerprint, split the output into
two lines.

Note that this change now requires OpenSSL 0.9.8+ [2005-07-05], and
GnuTLS 1.7.4+ [2007-02-05].

6 years agoRename pgpring to mutt_pgpring.
Kevin McCarthy [Wed, 29 Aug 2018 22:08:19 +0000 (15:08 -0700)]
Rename pgpring to mutt_pgpring.

pgpring is used by another common package, signing-party.  At the
request of ArchLinux, I am renaming our version to be prefixed by
"mutt_" in order to remove a naming conflict.

This is a minor inconvenience for pgp2, pgp5, and pgp6 users, but I
believe this constitutes an extremely small number of users at this
point.

I am keeping pgpewrap as-is because it is also used by GnuPG, and has
no such naming conflict.

6 years agoRemove extra lstats() in safe_rename() upon link success.
Kevin McCarthy [Wed, 29 Aug 2018 20:00:14 +0000 (13:00 -0700)]
Remove extra lstats() in safe_rename() upon link success.

I originally kept the lstat()'s in order to make as few changes as
possible to the function.  However, Derek Martin argues correctly that
if we are trusting the link() 0-retval, the lstats are unnecessary and
in fact can cause a performance impact over NFS.

6 years agoAdd additional error handling to safe_rename().
Kevin McCarthy [Mon, 27 Aug 2018 01:43:20 +0000 (18:43 -0700)]
Add additional error handling to safe_rename().

It is apparently possible for link() to return an error but the link
to still be created.  Add a double check for that case.  If the files
match, unlink the src and return success.

6 years agonew Finnish translation
Tommi A Pirinen [Tue, 28 Aug 2018 15:43:46 +0000 (17:43 +0200)]
new Finnish translation

6 years agoUpdated French translation.
Vincent Lefevre [Tue, 28 Aug 2018 12:07:31 +0000 (14:07 +0200)]
Updated French translation.

6 years agoUpdated French translation.
Vincent Lefevre [Tue, 28 Aug 2018 11:59:40 +0000 (13:59 +0200)]
Updated French translation.

6 years agoMerge branch 'stable'
Kevin McCarthy [Sun, 26 Aug 2018 23:10:13 +0000 (16:10 -0700)]
Merge branch 'stable'

6 years agoFix alias documentation examples.
Kevin McCarthy [Sun, 26 Aug 2018 23:08:06 +0000 (16:08 -0700)]
Fix alias documentation examples.

Thanks to Cody Brownstein for pointing out the problem.

6 years agoChange $query_format to use mutt_format_s.
Kevin McCarthy [Fri, 24 Aug 2018 22:49:49 +0000 (15:49 -0700)]
Change $query_format to use mutt_format_s.

Use the character-cell width functions so that multibyte output is
properly formatted.

6 years agoDisplay an error message if syncing fails.
Kevin McCarthy [Fri, 24 Aug 2018 19:56:54 +0000 (12:56 -0700)]
Display an error message if syncing fails.

Ticket 36 reported an issue where a maildir was removed while the
mailbox was opened.  Later, attempting to sync displayed the message
"Writing xxx...", which remained on the screen.  The reporter actually
thought mutt was frozen, but it was simply that on a sync error Mutt
wasn't clearing or updating the message window.

There is some error message handling for mbox.c check_mailbox, but I
don't think that is the right place to further propogate messages.
Instead, add an error to the same place the initial "Writing..."
message is created.

6 years agoAdd compose-to-sender functionality.
Kevin McCarthy [Wed, 22 Aug 2018 22:07:45 +0000 (15:07 -0700)]
Add compose-to-sender functionality.

This patch is loosely based on the NeoMutt feature, but adds in
support for the attach menu, reuses functionality in send.c, and has
proper mode checks.

Thanks to Enno for the opening the ticket requesting the port.

6 years agoFix nested macro warning.
Kevin McCarthy [Tue, 21 Aug 2018 22:51:09 +0000 (15:51 -0700)]
Fix nested macro warning.

Pull the #if/#else outside of the snprintf in imap.c.  On some
platforms, snprintf is a macro itself, which leads to a warning about
undefined behavior.

Thanks to Charles Diza for pointing out the problem.

6 years agoRemove compare_stat() call in safe_rename().
Kevin McCarthy [Tue, 14 Aug 2018 21:31:34 +0000 (14:31 -0700)]
Remove compare_stat() call in safe_rename().

Some filesystems, such as sshfs, implement hard links strangely.  The
hard link is created, but is represented by a different inode number
by the sshfs layer.  The current maildir code goes into an infinite
loop in this case.  Remove the compare_stat() and trust that a link()
return code of 0 means the link really did get created.  Still, keep
the stats just as a minor check.

6 years agoMerge branch 'stable'
Kevin McCarthy [Tue, 21 Aug 2018 22:18:24 +0000 (15:18 -0700)]
Merge branch 'stable'

6 years agoAdd autoconf check for libunistring when checking for idn2.
Kevin McCarthy [Tue, 21 Aug 2018 22:00:23 +0000 (15:00 -0700)]
Add autoconf check for libunistring when checking for idn2.

-lunistring is only explicitly needed when compiling statically, so
add a AC_SEARCH_LIBS to add it to LIBS if it is found.

Thanks to Fabrice Fontaine for the heads-up about the problem and the
merge request.

6 years agoUpdated French translation.
Vincent Lefevre [Thu, 16 Aug 2018 09:49:13 +0000 (11:49 +0200)]
Updated French translation.

6 years agoAllow ctrl-c to interrupt initial IMAP header download.
Kevin McCarthy [Wed, 15 Aug 2018 23:13:45 +0000 (16:13 -0700)]
Allow ctrl-c to interrupt initial IMAP header download.

Once the mailbox is open, it is significantly more complicated to
abort and keep Mutt from crashing.  But during the initial
open/download Mutt is prepared to close the mailbox cleanly on
failure.

6 years agoRemove legacy trim_incomplete_mbyte() in the pager.
Kevin McCarthy [Tue, 14 Aug 2018 21:04:05 +0000 (14:04 -0700)]
Remove legacy trim_incomplete_mbyte() in the pager.

Commit 4b1deb57 added the trim_incomplete_mbyte() call, but at
that time, the function was using fgets() into a fixed-sized
buffer.  The function was passing in "blen - 1" to the size
parameter of fgets, so the check for blen-2 was to see if the
buffer was completely filled by the fgets.

Commit d39d9c0c converted to use a dynamic buffer, but the
trim_incomplete_mbyte() was left in.  It now serves no purpose
because the entire line will be read in.  Presumably the buggy
regexp lib should have been fixed by now too.

6 years agoDon't match $abort_noattach_regexp on quoted lines.
Kevin McCarthy [Tue, 14 Aug 2018 02:02:32 +0000 (19:02 -0700)]
Don't match $abort_noattach_regexp on quoted lines.

6 years agoRefactor out mutt_is_quote_line().
Kevin McCarthy [Tue, 14 Aug 2018 01:56:37 +0000 (18:56 -0700)]
Refactor out mutt_is_quote_line().

This makes resolve_types() a tiny bit clearer, and will be usable by
$abort_noattach.

6 years agoConvert abort_noattach scan to use mutt_read_line().
Kevin McCarthy [Tue, 14 Aug 2018 01:22:58 +0000 (18:22 -0700)]
Convert abort_noattach scan to use mutt_read_line().

I should have fixed this up before committing the patch.

6 years agoOnly sync CONDSTORE and QRESYNC on the initial download.
Kevin McCarthy [Mon, 13 Aug 2018 16:43:55 +0000 (09:43 -0700)]
Only sync CONDSTORE and QRESYNC on the initial download.

In the midst of the imap_read_headers() refactor, I forgot to put this
guard on the /MODSEQ and /UIDSEQSET storage.

Because we don't deal with flag sync issues while the mailbox is open,
or when it closes, we only want to write those values to the header
cache during the initial download.

It makes no sense to perform all the header cache work if new messages
come into an open empty mailbox, so add a parameter to flag the
initial download, rather than check for msn_begin==1.

6 years agoUpdated French translation.
Vincent Lefevre [Sun, 12 Aug 2018 20:02:38 +0000 (22:02 +0200)]
Updated French translation.

6 years agoAdd more doc for the $imap_condstore and $imap_qresync options.
Kevin McCarthy [Sun, 12 Aug 2018 02:14:10 +0000 (19:14 -0700)]
Add more doc for the $imap_condstore and $imap_qresync options.

6 years agoAlways check UID vs MSN when handling FETCH.
Kevin McCarthy [Sun, 12 Aug 2018 00:59:54 +0000 (17:59 -0700)]
Always check UID vs MSN when handling FETCH.

Ensure the UID vs MSN check is always done before flags are processed,
not just if the UID happened to appear before the FLAGS.

Improve the debug messages to make it clearer why a fetch response is
being skipped.

6 years agoAdd QRESYNC support.
Kevin McCarthy [Sat, 26 May 2018 23:02:04 +0000 (16:02 -0700)]
Add QRESYNC support.

Refactor imap_read_headers() to break into functions for the different
queries.

Move uid_hash population to the same place msn_index is populated.

Change the VANISHED handler to not decrement MSNs for EARLIER.
FastMail, at least, does assume there are no gaps, and really it makes
no sense for there to be.  Further testing will be needed.

6 years agoAdd utility functions for QRESYNC support.
Kevin McCarthy [Thu, 24 May 2018 20:26:35 +0000 (13:26 -0700)]
Add utility functions for QRESYNC support.

* Add function to generate uid_seqset for header cache.
  This will be used by QREFRESH to reconstruct the msn_index state.

* Add seqset data structure and iterator functions.

* Add cmd_parse_vanished, for QRESYNC support.

* Add and enable QRESYNC capability.

* Create helper functions to store and retrieve the uid_seqset.

6 years agoAdd basic CONDSTORE support when fetching initial messages.
Kevin McCarthy [Tue, 15 May 2018 01:12:39 +0000 (18:12 -0700)]
Add basic CONDSTORE support when fetching initial messages.

Store MODSEQ in the header cache, and use that to perform a "FETCH
CHANGEDSINCE" for header updates when initially downloading messages.

Further improvements could be made to add support when syncing.
Handling MODSEQ for FLAG updates while the mailbox is open would be
complicated by the fact that Mutt supports locally modified headers,
so we couldn't accept the new (or subsequent) MODSEQ.

However, this initial step may at least provide some benefit when
opening the mailbox, which is generally the most time and data
intensive.

6 years agoCreate mutt_buffer_increase_size() function.
Kevin McCarthy [Sat, 26 May 2018 21:46:16 +0000 (14:46 -0700)]
Create mutt_buffer_increase_size() function.

This will allow preallocating buffers that we know are going to be
big for qresync support.

This will also be useful for buffer pools later on.

6 years agoMove exit cleanup in main() to end of function.
Kevin McCarthy [Sun, 29 Jul 2018 01:43:31 +0000 (18:43 -0700)]
Move exit cleanup in main() to end of function.

Route exits to the same place to ensure uniform cleanup.

Message printing is a bit of a mess, but for now, try to keep the
exact same behavior.

6 years agoFix -z and -Z options to work with IMAP.
Kevin McCarthy [Sat, 28 Jul 2018 22:26:34 +0000 (15:26 -0700)]
Fix -z and -Z options to work with IMAP.

-Z did not work if $imap_passive was set (the default).  I think using
the option implies the desire to open a new connection and check
buffy at startup, so temporarily turn it off during the buffy.

-z was not hooked up for IMAP.  Change it to call imap_status().  This
also requires $imap_passive be unset, so temporarily turn the option
off too.

6 years agoAdd a note about doc/manual.tex generation.
Kevin McCarthy [Sat, 28 Jul 2018 20:16:50 +0000 (13:16 -0700)]
Add a note about doc/manual.tex generation.

The invocation doesn't work for me, but does work for Ken.  I'm
reluctant to touch and break it for existing users, so instead
add a note to the Makefile.am.  Perhaps someone with more knowledge of
those tools can make it portable.

6 years agoFix AUXSORT usage in compare_spam.
Kevin McCarthy [Sat, 28 Jul 2018 19:59:35 +0000 (12:59 -0700)]
Fix AUXSORT usage in compare_spam.

AUXSORT already checks if the first parameter is zero.

Additionally, the macro expands into more than one statement, so
putting inside an unbracketed if is misleading and generates a
warning on the latest gcc.

Fortunately, both statements checked if the first parameter was zero,
so no actual bug resulted.