mutt: Change sidebar to only match $folder prefix on a $sidebar_...

2016-10-16 Thread Brendan Cully
changeset: 6822:18c3db1aa8c4
user:  Kevin McCarthy 
date:  Sun Oct 16 15:44:17 2016 -0700
link:  http://dev.mutt.org/hg/mutt/rev/18c3db1aa8c4

Change sidebar to only match $folder prefix on a $sidebar_divider_char. (closes 
#3887)

The reporter had a $spoolfile of ~/Mailbox and a $folder of ~/Mail.
The sidebar was truncating the spoolfile to "ox" because it only
looked at a substring prefix match.

diffs (15 lines):

diff -r 7e174b2fcbe1 -r 18c3db1aa8c4 sidebar.c
--- a/sidebar.c Sun Oct 16 15:14:32 2016 -0700
+++ b/sidebar.c Sun Oct 16 15:44:17 2016 -0700
@@ -595,7 +595,10 @@
 
 /* check whether Maildir is a prefix of the current folder's path */
 short maildir_is_prefix = 0;
-if ((mutt_strlen (b->path) > maildirlen) && (mutt_strncmp (Maildir, 
b->path, maildirlen) == 0))
+if ((mutt_strlen (b->path) > maildirlen) &&
+(mutt_strncmp (Maildir, b->path, maildirlen) == 0) &&
+SidebarDelimChars &&
+strchr (SidebarDelimChars, b->path[maildirlen]))
   maildir_is_prefix = 1;
 
 /* calculate depth of current folder and generate its display name with 
indented spaces */


Re: [Mutt] #3887: Spool file name beginning with $folder is truncated in sidebar

2016-10-16 Thread Mutt
#3887: Spool file name beginning with $folder is truncated in sidebar
--+--
  Reporter:  mjbrown  |  Owner:  mutt-dev
  Type:  defect   | Status:  closed
  Priority:  trivial  |  Milestone:
 Component:  display  |Version:  1.7.0
Resolution:  fixed|   Keywords:
--+--
Changes (by Kevin McCarthy ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"18c3db1aa8c44c507d58302a103de0d65c39fdfe"
 6822:18c3db1aa8c4]:
 {{{
 #!CommitTicketReference repository=""
 revision="18c3db1aa8c44c507d58302a103de0d65c39fdfe"
 Change sidebar to only match $folder prefix on a $sidebar_divider_char.
 (closes #3887)

 The reporter had a $spoolfile of ~/Mailbox and a $folder of ~/Mail.
 The sidebar was truncating the spoolfile to "ox" because it only
 looked at a substring prefix match.
 }}}

--
Ticket URL: 
Mutt 
The Mutt mail user agent



mutt: 2 new changesets

2016-10-16 Thread Brendan Cully
changeset: 6820:783dce6dfcd4
user:  Kevin McCarthy 
date:  Sun Oct 16 15:12:33 2016 -0700
link:  http://dev.mutt.org/hg/mutt/rev/783dce6dfcd4

Use mutt_strlen and mutt_strncmp in sidebar.c.

This prevents a segv if folder is unset.

changeset: 6821:7e174b2fcbe1
user:  Kevin McCarthy 
date:  Sun Oct 16 15:14:32 2016 -0700
link:  http://dev.mutt.org/hg/mutt/rev/7e174b2fcbe1

merge stable

diffs (truncated from 3078 to 950 lines):

diff -r 6e44bfa16096 -r 7e174b2fcbe1 browser.c
--- a/browser.c Sun Oct 16 14:16:47 2016 -0700
+++ b/browser.c Sun Oct 16 15:14:32 2016 -0700
@@ -176,11 +176,12 @@
  tnow = time (NULL);
  t_fmt = tnow - folder->ff->mtime < 31536000 ? "%b %d %H:%M" : "%b %d  
%Y";
}
-   if (do_locales)
- setlocale(LC_TIME, NONULL (Locale)); /* use environment if $locale is 
not set */
-   else
- setlocale(LC_TIME, "C");
-   strftime (date, sizeof (date), t_fmt, localtime (>ff->mtime));
+
+if (!do_locales)
+  setlocale (LC_TIME, "C");
+strftime (date, sizeof (date), t_fmt, localtime (>ff->mtime));
+if (!do_locales)
+  setlocale (LC_TIME, "");
 
mutt_format_s (dest, destlen, fmt, date);
   }
diff -r 6e44bfa16096 -r 7e174b2fcbe1 configure.ac
--- a/configure.ac  Sun Oct 16 14:16:47 2016 -0700
+++ b/configure.ac  Sun Oct 16 15:14:32 2016 -0700
@@ -689,13 +689,16 @@
 
 crypto_libs=""
 AC_CHECK_LIB(z, deflate, [crypto_libs=-lz])
-AC_CHECK_LIB(crypto, X509_new,
-  [crypto_libs="-lcrypto $crypto_libs"],, [$crypto_libs])
+AC_CHECK_LIB(crypto, X509_STORE_CTX_new,
+  [crypto_libs="-lcrypto $crypto_libs"],
+  AC_MSG_ERROR([Unable to find SSL library]), [$crypto_libs])
 AC_CHECK_LIB(ssl, SSL_new,,
   AC_MSG_ERROR([Unable to find SSL library]), [$crypto_libs])
 
 LIBS="$LIBS $crypto_libs"
 AC_CHECK_FUNCS(RAND_status RAND_egd)
+AC_CHECK_DECLS([SSL_set_mode, SSL_MODE_AUTO_RETRY],,
+  AC_MSG_ERROR([Unable to find decent SSL header]), [[#include 
]])
 
 AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ])
 AC_DEFINE(USE_SSL_OPENSSL,1,[ Define if you want support for SSL 
via OpenSSL. ])
diff -r 6e44bfa16096 -r 7e174b2fcbe1 crypt-gpgme.c
--- a/crypt-gpgme.c Sun Oct 16 14:16:47 2016 -0700
+++ b/crypt-gpgme.c Sun Oct 16 15:14:32 2016 -0700
@@ -872,14 +872,12 @@
 {
   char p[STRING];
 
-  setlocale (LC_TIME, "");
 #ifdef HAVE_LANGINFO_D_T_FMT
   strftime (p, sizeof (p), nl_langinfo (D_T_FMT), localtime ());
 #else
   strftime (p, sizeof (p), "%c", localtime ());
 #endif
-  setlocale (LC_TIME, "C");
-  state_attach_puts (p, s);
+  state_puts (p, s);
 }
 
 /* 
@@ -1144,7 +1142,7 @@
 
   if ((sum & GPGME_SIGSUM_KEY_REVOKED))
 {
-  state_attach_puts (_("Warning: One of the keys has been revoked\n"),s);
+  state_puts (_("Warning: One of the keys has been revoked\n"),s);
   severe = 1;
 }
 
@@ -1153,13 +1151,13 @@
   time_t at = key->subkeys->expires ? key->subkeys->expires : 0;
   if (at)
 {
-  state_attach_puts (_("Warning: The key used to create the "
+  state_puts (_("Warning: The key used to create the "
"signature expired at: "), s);
   print_time (at , s);
-  state_attach_puts ("\n", s);
+  state_puts ("\n", s);
 }
   else
-state_attach_puts (_("Warning: At least one certification key "
+state_puts (_("Warning: At least one certification key "
  "has expired\n"), s);
 }
 
@@ -1175,29 +1173,29 @@
sig = sig->next, i++)
 ;
   
-  state_attach_puts (_("Warning: The signature expired at: "), s);
+  state_puts (_("Warning: The signature expired at: "), s);
   print_time (sig ? sig->exp_timestamp : 0, s);
-  state_attach_puts ("\n", s);
+  state_puts ("\n", s);
 }
 
   if ((sum & GPGME_SIGSUM_KEY_MISSING))
-state_attach_puts (_("Can't verify due to a missing "
+state_puts (_("Can't verify due to a missing "
  "key or certificate\n"), s);
 
   if ((sum & GPGME_SIGSUM_CRL_MISSING))
 {
-  state_attach_puts (_("The CRL is not available\n"), s);
+  state_puts (_("The CRL is not available\n"), s);
   severe = 1;
 }
 
   if ((sum & GPGME_SIGSUM_CRL_TOO_OLD))
 {
-  state_attach_puts (_("Available CRL is too old\n"), s);
+  state_puts (_("Available CRL is too old\n"), s);
   severe = 1;
 }
 
   if ((sum & GPGME_SIGSUM_BAD_POLICY))
-state_attach_puts (_("A policy requirement was not met\n"), s);
+state_puts (_("A policy requirement was not met\n"), s);
 
   if ((sum & GPGME_SIGSUM_SYS_ERROR))
 {
@@ -1206,7 +1204,7 @@
   gpgme_signature_t sig;
   unsigned int i;
 
-  

mutt: 2 new changesets

2016-10-16 Thread Brendan Cully
changeset: 6818:6e44bfa16096
user:  Kevin McCarthy 
date:  Sun Oct 16 14:16:47 2016 -0700
link:  http://dev.mutt.org/hg/mutt/rev/6e44bfa16096

Fix gpgme segfault in create_recipient_set().

If gpgme_get_key() errors on the first key, the rset will not be
allocated yet.  Attempting to null-terminate (and then free) the array
causes a segfault.

changeset: 6819:023181b27fb6
user:  Kevin McCarthy 
date:  Sun Oct 16 14:17:51 2016 -0700
link:  http://dev.mutt.org/hg/mutt/rev/023181b27fb6

merge stable

diffs (truncated from 3032 to 950 lines):

diff -r 58f4b38312bf -r 023181b27fb6 browser.c
--- a/browser.c Sat Oct 08 12:57:57 2016 -0700
+++ b/browser.c Sun Oct 16 14:17:51 2016 -0700
@@ -176,11 +176,12 @@
  tnow = time (NULL);
  t_fmt = tnow - folder->ff->mtime < 31536000 ? "%b %d %H:%M" : "%b %d  
%Y";
}
-   if (do_locales)
- setlocale(LC_TIME, NONULL (Locale)); /* use environment if $locale is 
not set */
-   else
- setlocale(LC_TIME, "C");
-   strftime (date, sizeof (date), t_fmt, localtime (>ff->mtime));
+
+if (!do_locales)
+  setlocale (LC_TIME, "C");
+strftime (date, sizeof (date), t_fmt, localtime (>ff->mtime));
+if (!do_locales)
+  setlocale (LC_TIME, "");
 
mutt_format_s (dest, destlen, fmt, date);
   }
diff -r 58f4b38312bf -r 023181b27fb6 configure.ac
--- a/configure.ac  Sat Oct 08 12:57:57 2016 -0700
+++ b/configure.ac  Sun Oct 16 14:17:51 2016 -0700
@@ -689,13 +689,16 @@
 
 crypto_libs=""
 AC_CHECK_LIB(z, deflate, [crypto_libs=-lz])
-AC_CHECK_LIB(crypto, X509_new,
-  [crypto_libs="-lcrypto $crypto_libs"],, [$crypto_libs])
+AC_CHECK_LIB(crypto, X509_STORE_CTX_new,
+  [crypto_libs="-lcrypto $crypto_libs"],
+  AC_MSG_ERROR([Unable to find SSL library]), [$crypto_libs])
 AC_CHECK_LIB(ssl, SSL_new,,
   AC_MSG_ERROR([Unable to find SSL library]), [$crypto_libs])
 
 LIBS="$LIBS $crypto_libs"
 AC_CHECK_FUNCS(RAND_status RAND_egd)
+AC_CHECK_DECLS([SSL_set_mode, SSL_MODE_AUTO_RETRY],,
+  AC_MSG_ERROR([Unable to find decent SSL header]), [[#include 
]])
 
 AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ])
 AC_DEFINE(USE_SSL_OPENSSL,1,[ Define if you want support for SSL 
via OpenSSL. ])
diff -r 58f4b38312bf -r 023181b27fb6 crypt-gpgme.c
--- a/crypt-gpgme.c Sat Oct 08 12:57:57 2016 -0700
+++ b/crypt-gpgme.c Sun Oct 16 14:17:51 2016 -0700
@@ -682,8 +682,11 @@
  {
mutt_error (_("error adding recipient `%s': %s\n"),
buf, gpgme_strerror (err));
-   rset[rset_n] = NULL;
-   free_recipient_set ();
+if (rset)
+  {
+rset[rset_n] = NULL;
+free_recipient_set ();
+  }
gpgme_release (context);
return NULL;
  }
@@ -869,14 +872,12 @@
 {
   char p[STRING];
 
-  setlocale (LC_TIME, "");
 #ifdef HAVE_LANGINFO_D_T_FMT
   strftime (p, sizeof (p), nl_langinfo (D_T_FMT), localtime ());
 #else
   strftime (p, sizeof (p), "%c", localtime ());
 #endif
-  setlocale (LC_TIME, "C");
-  state_attach_puts (p, s);
+  state_puts (p, s);
 }
 
 /* 
@@ -1141,7 +1142,7 @@
 
   if ((sum & GPGME_SIGSUM_KEY_REVOKED))
 {
-  state_attach_puts (_("Warning: One of the keys has been revoked\n"),s);
+  state_puts (_("Warning: One of the keys has been revoked\n"),s);
   severe = 1;
 }
 
@@ -1150,13 +1151,13 @@
   time_t at = key->subkeys->expires ? key->subkeys->expires : 0;
   if (at)
 {
-  state_attach_puts (_("Warning: The key used to create the "
+  state_puts (_("Warning: The key used to create the "
"signature expired at: "), s);
   print_time (at , s);
-  state_attach_puts ("\n", s);
+  state_puts ("\n", s);
 }
   else
-state_attach_puts (_("Warning: At least one certification key "
+state_puts (_("Warning: At least one certification key "
  "has expired\n"), s);
 }
 
@@ -1172,29 +1173,29 @@
sig = sig->next, i++)
 ;
   
-  state_attach_puts (_("Warning: The signature expired at: "), s);
+  state_puts (_("Warning: The signature expired at: "), s);
   print_time (sig ? sig->exp_timestamp : 0, s);
-  state_attach_puts ("\n", s);
+  state_puts ("\n", s);
 }
 
   if ((sum & GPGME_SIGSUM_KEY_MISSING))
-state_attach_puts (_("Can't verify due to a missing "
+state_puts (_("Can't verify due to a missing "
  "key or certificate\n"), s);
 
   if ((sum & GPGME_SIGSUM_CRL_MISSING))
 {
-  state_attach_puts (_("The CRL is not available\n"), s);
+   

Re: [Mutt] #3681: Cannot use IPv6 literal address in IMAP/POP3 URL

2016-10-16 Thread Mutt
#3681: Cannot use IPv6 literal address in IMAP/POP3 URL
--+--
  Reporter:  evgeni   |  Owner:  kevin8t8
  Type:  enhancement  | Status:  assigned
  Priority:  minor|  Milestone:
 Component:  mutt |Version:
Resolution:   |   Keywords:
--+--
Changes (by kevin8t8):

 * Attachment "ticket-3681-v2.patch" added.


--
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3681: Cannot use IPv6 literal address in IMAP/POP3 URL

2016-10-16 Thread Mutt
#3681: Cannot use IPv6 literal address in IMAP/POP3 URL
--+--
  Reporter:  evgeni   |  Owner:  kevin8t8
  Type:  enhancement  | Status:  assigned
  Priority:  minor|  Milestone:
 Component:  mutt |Version:
Resolution:   |   Keywords:
--+--

Comment (by kevin8t8):

 After thinking about it some more, I don't think it's correct to leave the
 "[]" delimiters in the ciss.host field.

 The reason this was done is because mutt converts it back and forth
 between a URL string, so instead the delimiters were removed inside
 raw_socket_open.  However there are other places in the code that use the
 host field, and they shouldn't all have the responsibility of stripping
 the "[]" off.

 I'm attaching v2 patch that removes the delimiter inside
 ciss_parse_userhost() but puts them back on inside url_ciss_tostring() if
 the host name contains a ':'.  This version of the patch therefor doesn't
 need to touch raw_socket_open().

--
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3681: Cannot use IPv6 literal address in IMAP/POP3 URL

2016-10-16 Thread Mutt
#3681: Cannot use IPv6 literal address in IMAP/POP3 URL
--+--
  Reporter:  evgeni   |  Owner:  kevin8t8
  Type:  enhancement  | Status:  assigned
  Priority:  minor|  Milestone:
 Component:  mutt |Version:
Resolution:   |   Keywords:
--+--
Changes (by kevin8t8):

 * Attachment "ticket-3681.patch" added.


--
Ticket URL: 
Mutt 
The Mutt mail user agent