aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorriggs <riggs@FreeBSD.org>2015-09-13 17:18:09 +0800
committerriggs <riggs@FreeBSD.org>2015-09-13 17:18:09 +0800
commit23147cbade5a2417fbd4a27f0a5c62eff3f0ecbe (patch)
tree27bdd69a20e397ffe84ac9384ab6ca03eab08ccf /mail
parent3039bb892d90e7fb61225464123049372aaeb249 (diff)
downloadfreebsd-ports-gnome-23147cbade5a2417fbd4a27f0a5c62eff3f0ecbe.tar.gz
freebsd-ports-gnome-23147cbade5a2417fbd4a27f0a5c62eff3f0ecbe.tar.zst
freebsd-ports-gnome-23147cbade5a2417fbd4a27f0a5c62eff3f0ecbe.zip
Update to upstream version 1.5.24, add MIXMASTER OPTION
PR: 203056, 202114 Submitted by: Udo.Schweigert@siemens.com (maintainer)
Diffstat (limited to 'mail')
-rw-r--r--mail/mutt/Makefile17
-rw-r--r--mail/mutt/distinfo24
-rw-r--r--mail/mutt/files/extra-patch-sidebar729
-rw-r--r--mail/mutt/files/extra-patch-sidebar-nntp755
-rw-r--r--mail/mutt/files/extra-patch-trash-purge12
-rw-r--r--mail/mutt/files/patch-CVE-2014-911643
-rw-r--r--mail/mutt/files/patch-Makefile.am15
-rw-r--r--mail/mutt/files/patch-curs_lib.c43
-rw-r--r--mail/mutt/files/patch-examples70
-rw-r--r--mail/mutt/files/patch-gpg_agent_info95
-rw-r--r--mail/mutt/files/patch-mktemp16
-rw-r--r--mail/mutt/files/patch-pgpkey.c18
-rw-r--r--mail/mutt/files/patch-smime-self23
-rw-r--r--mail/mutt/files/patch-smime-sender17
-rw-r--r--mail/mutt/files/patch-staging-Makefile.am24
15 files changed, 800 insertions, 1101 deletions
diff --git a/mail/mutt/Makefile b/mail/mutt/Makefile
index 9117d4d698f1..4480f0eb011c 100644
--- a/mail/mutt/Makefile
+++ b/mail/mutt/Makefile
@@ -2,15 +2,13 @@
# $FreeBSD$
PORTNAME= mutt
-PORTVERSION= 1.5.23
-PORTREVISION?= 9
+PORTVERSION= 1.5.24
+PORTREVISION?= 0
CATEGORIES+= mail ipv6
MASTER_SITES= ftp://ftp.mutt.org/mutt/ \
- ftp://ftp.mutt.org/mutt/devel/ \
ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/ \
- ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/devel/ \
+ https://bitbucket.org/mutt/mutt/downloads/ \
ftp://ftp.demon.co.uk/pub/mirrors/mutt/ \
- ftp://ftp.demon.co.uk/pub/mirrors/mutt/devel/ \
http://www.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \
http://www2.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \
http://www3.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \
@@ -66,7 +64,7 @@ OPTIONS_DEFINE= COMPRESSED_FOLDERS SASL DEBUG DOCS EXAMPLES FLOCK \
GPGME GREETING_PATCH GSSAPI HTML ICONV IDN IFDEF_PATCH \
IMAP_HEADER_CACHE LOCALES_FIX MAILBOX_MANPAGES \
MAILDIR_HEADER_CACHE MAILDIR_MTIME_PATCH \
- NLS NNTP PARENT_CHILD_MATCH_PATCH \
+ MIXMASTER NLS NNTP PARENT_CHILD_MATCH_PATCH \
QUOTE_PATCH REVERSE_REPLY_PATCH SIDEBAR_PATCH \
SIGNATURE_MENU SMART_DATE SMIME_OUTLOOK_COMPAT SMTP \
TOKYOCABINET TRASH_PATCH XML
@@ -91,6 +89,7 @@ MAILBOX_MANPAGES_DESC= Install mbox.5/mmdf.5 manpages
MAILDIR_HEADER_CACHE_DESC= Maildir header cache
MAILDIR_MTIME_PATCH_DESC= Maildir mtime patch
MBOX_HOOK_PATCH_DESC= Enhanced mbox-hook
+MIXMASTER_DESC= Mixmaster support
NCURSES_DESC= Ncurses support
NLS_DESC= Native language support
PARENT_CHILD_MATCH_PATCH_DESC= Parent/child match
@@ -188,6 +187,12 @@ LIB_DEPENDS+= libsasl2.so:${PORTSDIR}/security/cyrus-sasl2
CONFIGURE_ARGS+= --with-sasl=${LOCALBASE}
.endif
+.if ${PORT_OPTIONS:MMIXMASTER}
+# BUILD_DEPENDS+= mixmaster:${PORTSDIR}/mail/mixmaster
+RUN_DEPENDS+= mixmaster:${PORTSDIR}/mail/mixmaster
+CONFIGURE_ARGS+= --with-mixmaster=${LOCALBASE}
+.endif
+
.if ${PORT_OPTIONS:MSMIME_OUTLOOK_COMPAT}
post-patch::
@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook
diff --git a/mail/mutt/distinfo b/mail/mutt/distinfo
index 09f622c587c2..d906bf46718a 100644
--- a/mail/mutt/distinfo
+++ b/mail/mutt/distinfo
@@ -1,12 +1,12 @@
-SHA256 (mutt/mutt-1.5.23.tar.gz) = 3af0701e57b9e1880ed3a0dee34498a228939e854a16cdccd24e5e502626fd37
-SIZE (mutt/mutt-1.5.23.tar.gz) = 3782032
-SHA256 (mutt/patch-1.5.23.rr.compressed.gz) = 585d0df6e251ca4519327e85923f580d685fc33aaa9c8c532e0916224b43134f
-SIZE (mutt/patch-1.5.23.rr.compressed.gz) = 10127
-SHA256 (mutt/patch-1.5.23.vvv.nntp.gz) = 281f56aa60b01860f4b5d4ad43a000a14d39d7a69c17fa3983dc6463e1675589
-SIZE (mutt/patch-1.5.23.vvv.nntp.gz) = 61184
-SHA256 (mutt/patch-1.5.23.vvv.nntp_ru.gz) = 8e36a8eb90bb9085d5fdf8bde1d80adff90c7d1e0982eae34b81df4eb2e5c6bd
-SIZE (mutt/patch-1.5.23.vvv.nntp_ru.gz) = 5733
-SHA256 (mutt/patch-1.5.23.vvv.initials.gz) = d02fc55ac846bcaa241a1af644988d906192081584f85d971be42c37f39e6e23
-SIZE (mutt/patch-1.5.23.vvv.initials.gz) = 673
-SHA256 (mutt/patch-1.5.23.vvv.quote.gz) = 2e98fafe8e221e1a0dd923bd71bf53245aa1141c99aae4c93bef35f1a25cdc10
-SIZE (mutt/patch-1.5.23.vvv.quote.gz) = 1260
+SHA256 (mutt/mutt-1.5.24.tar.gz) = a292ca765ed7b19db4ac495938a3ef808a16193b7d623d65562bb8feb2b42200
+SIZE (mutt/mutt-1.5.24.tar.gz) = 3897115
+SHA256 (mutt/patch-1.5.24.rr.compressed.gz) = c5eb9b53f7bd3feaa5ee03722575f64e43512b756c099ffe20db6fe5c958e3dc
+SIZE (mutt/patch-1.5.24.rr.compressed.gz) = 10019
+SHA256 (mutt/patch-1.5.24.vvv.nntp.gz) = d34be4542d549aab6de9f7038c88b3eeefe826db643c92b27e1e65ab5f7d573e
+SIZE (mutt/patch-1.5.24.vvv.nntp.gz) = 61359
+SHA256 (mutt/patch-1.5.24.vvv.nntp_ru.gz) = 70436af316aefd0d31aa33e127df49da4bdd1b4a8b3fbec73b3fca5428f3ab0e
+SIZE (mutt/patch-1.5.24.vvv.nntp_ru.gz) = 5719
+SHA256 (mutt/patch-1.5.24.vvv.initials.gz) = 6522d12d34c0be71531465e05010413a0f2907d597e9fb5100a65d18093f0599
+SIZE (mutt/patch-1.5.24.vvv.initials.gz) = 671
+SHA256 (mutt/patch-1.5.24.vvv.quote.gz) = fa161302179bbc646a83d7029381f828bece5b177e940f2fca6d5769633b9f0a
+SIZE (mutt/patch-1.5.24.vvv.quote.gz) = 1254
diff --git a/mail/mutt/files/extra-patch-sidebar b/mail/mutt/files/extra-patch-sidebar
index f2b10f729068..12b3b858ab09 100644
--- a/mail/mutt/files/extra-patch-sidebar
+++ b/mail/mutt/files/extra-patch-sidebar
@@ -1,281 +1,236 @@
Taken from http://lunar-linux.org/~tchan/mutt/patch-1.5.23.sidebar.20140412.txt
diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
-*** mutt-1.5.23-orig/buffy.c 2014-03-12 11:03:44.000000000 -0500
---- mutt-1.5.23/buffy.c 2014-04-12 15:33:54.000000000 -0500
-***************
-*** 161,166 ****
---- 161,209 ----
- }
- }
-
-+ static int buffy_compare_name(const void *a, const void *b) {
-+ const BUFFY *b1 = * (BUFFY * const *) a;
-+ const BUFFY *b2 = * (BUFFY * const *) b;
-+
-+ return mutt_strcoll(b1->path, b2->path);
-+ }
-+
-+ static BUFFY *buffy_sort(BUFFY *b)
-+ {
-+ BUFFY *tmp = b;
-+ int buffycount = 0;
-+ BUFFY **ary;
-+ int i;
-+
-+ if (!option(OPTSIDEBARSORT))
-+ return b;
-+
-+ for (; tmp != NULL; tmp = tmp->next)
-+ buffycount++;
-+
-+ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
-+
-+ tmp = b;
-+ for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
-+ ary[i] = tmp;
-+ }
-+
-+ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
-+
-+ for (i = 0; i < buffycount - 1; i++) {
-+ ary[i]->next = ary[i+1];
-+ }
-+ ary[buffycount - 1]->next = NULL;
-+ for (i = 1; i < buffycount; i++) {
-+ ary[i]->prev = ary[i-1];
-+ }
-+ ary[0]->prev = NULL;
-+
-+ tmp = ary[0];
-+ free(ary);
-+ return tmp;
-+ }
-+
- BUFFY *mutt_find_mailbox (const char *path)
- {
- BUFFY *tmp = NULL;
-***************
-*** 196,204 ****
---- 239,251 ----
- static BUFFY *buffy_new (const char *path)
- {
- BUFFY* buffy;
-+ char rp[PATH_MAX];
-+ char *r;
-
- buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
- strfcpy (buffy->path, path, sizeof (buffy->path));
-+ r = realpath(path, rp);
-+ strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath));
- buffy->next = NULL;
- buffy->magic = 0;
-
-***************
-*** 243,250 ****
- p = realpath (buf, f1);
- for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next))
- {
-! q = realpath ((*tmp)->path, f2);
-! if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0)
- {
- dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
- break;
---- 290,297 ----
- p = realpath (buf, f1);
- for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next))
- {
-! q = (*tmp)->realpath;
-! if (mutt_strcmp (p ? p : buf, q) == 0)
- {
- dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
- break;
-***************
-*** 282,287 ****
---- 329,335 ----
- else
- (*tmp)->size = 0;
- }
-+ Incoming = buffy_sort(Incoming);
- return 0;
- }
-
-***************
-*** 306,311 ****
---- 354,364 ----
- return 0;
- }
-
-+ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) {
-+ mailbox->new = 1;
-+ return 1;
-+ }
-+
- if ((dirp = opendir (path)) == NULL)
- {
- mailbox->magic = 0;
-***************
-*** 340,345 ****
---- 393,464 ----
- return rc;
- }
-
-+ /* update message counts for the sidebar */
-+ void buffy_maildir_update (BUFFY* mailbox)
-+ {
-+ char path[_POSIX_PATH_MAX];
-+ DIR *dirp;
-+ struct dirent *de;
-+ char *p;
-+
-+ if(!option(OPTSIDEBAR))
-+ return;
-+
-+ mailbox->msgcount = 0;
-+ mailbox->msg_unread = 0;
-+ mailbox->msg_flagged = 0;
-+
-+ snprintf (path, sizeof (path), "%s/new", mailbox->path);
-+
-+ if ((dirp = opendir (path)) == NULL)
-+ {
-+ mailbox->magic = 0;
-+ return;
-+ }
-+
-+ while ((de = readdir (dirp)) != NULL)
-+ {
-+ if (*de->d_name == '.')
-+ continue;
-+
-+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
-+ mailbox->new = 1;
-+ mailbox->msgcount++;
-+ mailbox->msg_unread++;
-+ }
-+ }
-+
-+ closedir (dirp);
-+ snprintf (path, sizeof (path), "%s/cur", mailbox->path);
-+
-+ if ((dirp = opendir (path)) == NULL)
-+ {
-+ mailbox->magic = 0;
-+ return;
-+ }
-+
-+ while ((de = readdir (dirp)) != NULL)
-+ {
-+ if (*de->d_name == '.')
-+ continue;
-+
-+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
-+ mailbox->msgcount++;
-+ if ((p = strstr (de->d_name, ":2,"))) {
-+ if (!strchr (p + 3, 'T')) {
-+ if (!strchr (p + 3, 'S'))
-+ mailbox->msg_unread++;
-+ if (strchr(p + 3, 'F'))
-+ mailbox->msg_flagged++;
-+ }
-+ }
-+ }
-+ }
-+
-+ mailbox->sb_last_checked = time(NULL);
-+ closedir (dirp);
-+ }
-+
- /* returns 1 if mailbox has new mail */
- static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
- {
-***************
-*** 351,357 ****
- else
- statcheck = sb->st_mtime > sb->st_atime
- || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime);
-! if (statcheck)
- {
- if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
- {
---- 470,476 ----
- else
- statcheck = sb->st_mtime > sb->st_atime
- || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime);
-! if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0))
- {
- if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
- {
-***************
-*** 371,376 ****
---- 490,516 ----
- return rc;
- }
-
-+ /* update message counts for the sidebar */
-+ void buffy_mbox_update (BUFFY* mailbox, struct stat *sb)
-+ {
-+ CONTEXT *ctx = NULL;
-+
-+ if(!option(OPTSIDEBAR))
-+ return;
-+ if(mailbox->sb_last_checked > sb->st_mtime && mailbox->msgcount != 0)
-+ return; /* no check necessary */
-+
-+ ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
-+ if(ctx)
-+ {
-+ mailbox->msgcount = ctx->msgcount;
-+ mailbox->msg_unread = ctx->unread;
-+ mailbox->msg_flagged = ctx->flagged;
-+ mailbox->sb_last_checked = time(NULL);
-+ mx_close_mailbox(ctx, 0);
-+ }
-+ }
-+
- int mutt_buffy_check (int force)
- {
- BUFFY *tmp;
-***************
-*** 444,460 ****
- {
- case M_MBOX:
- case M_MMDF:
- if (buffy_mbox_hasnew (tmp, &sb) > 0)
- BuffyCount++;
- break;
-
- case M_MAILDIR:
- if (buffy_maildir_hasnew (tmp) > 0)
- BuffyCount++;
- break;
-
- case M_MH:
-! mh_buffy(tmp);
- if (tmp->new)
- BuffyCount++;
- break;
---- 584,603 ----
- {
- case M_MBOX:
- case M_MMDF:
-+ buffy_mbox_update (tmp, &sb);
- if (buffy_mbox_hasnew (tmp, &sb) > 0)
- BuffyCount++;
- break;
-
- case M_MAILDIR:
-+ buffy_maildir_update (tmp);
- if (buffy_maildir_hasnew (tmp) > 0)
- BuffyCount++;
- break;
-
- case M_MH:
-! mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked);
-! mh_buffy(tmp);
- if (tmp->new)
- BuffyCount++;
- break;
+*** mutt-1.5.23-orig/buffy.c.orig 2015-08-30 19:06:38.000000000 +0200
+--- mutt-1.5.23/buffy.c 2015-09-10 09:31:22.000000000 +0200
+@@ -161,6 +161,49 @@
+ }
+ }
+
++static int buffy_compare_name(const void *a, const void *b) {
++ const BUFFY *b1 = * (BUFFY * const *) a;
++ const BUFFY *b2 = * (BUFFY * const *) b;
++
++ return mutt_strcoll(b1->path, b2->path);
++}
++
++static BUFFY *buffy_sort(BUFFY *b)
++{
++ BUFFY *tmp = b;
++ int buffycount = 0;
++ BUFFY **ary;
++ int i;
++
++ if (!option(OPTSIDEBARSORT))
++ return b;
++
++ for (; tmp != NULL; tmp = tmp->next)
++ buffycount++;
++
++ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
++
++ tmp = b;
++ for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
++ ary[i] = tmp;
++ }
++
++ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
++
++ for (i = 0; i < buffycount - 1; i++) {
++ ary[i]->next = ary[i+1];
++ }
++ ary[buffycount - 1]->next = NULL;
++ for (i = 1; i < buffycount; i++) {
++ ary[i]->prev = ary[i-1];
++ }
++ ary[0]->prev = NULL;
++
++ tmp = ary[0];
++ free(ary);
++ return tmp;
++}
++
+ BUFFY *mutt_find_mailbox (const char *path)
+ {
+ BUFFY *tmp = NULL;
+@@ -196,9 +239,13 @@
+ static BUFFY *buffy_new (const char *path)
+ {
+ BUFFY* buffy;
++ char rp[PATH_MAX];
++ char *r;
+
+ buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
+ strfcpy (buffy->path, path, sizeof (buffy->path));
++ r = realpath(path, rp);
++ strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath));
+ buffy->next = NULL;
+ buffy->magic = 0;
+
+@@ -243,8 +290,8 @@
+ p = realpath (buf, f1);
+ for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next))
+ {
+- q = realpath ((*tmp)->path, f2);
+- if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0)
++ q = (*tmp)->realpath;
++ if (mutt_strcmp (p ? p : buf, q) == 0)
+ {
+ dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
+ break;
+@@ -282,6 +329,7 @@
+ else
+ (*tmp)->size = 0;
+ }
++ Incoming = buffy_sort(Incoming);
+ return 0;
+ }
+
+@@ -306,6 +354,11 @@
+ return 0;
+ }
+
++ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) {
++ mailbox->new = 1;
++ return 1;
++ }
++
+ if ((dirp = opendir (path)) == NULL)
+ {
+ mailbox->magic = 0;
+@@ -357,6 +410,73 @@
+
+ return 0;
+ }
++
++/* update message counts for the sidebar */
++void buffy_maildir_update (BUFFY* mailbox)
++{
++ char path[_POSIX_PATH_MAX];
++ DIR *dirp;
++ struct dirent *de;
++ char *p;
++
++ if(!option(OPTSIDEBAR))
++ return;
++
++ mailbox->msgcount = 0;
++ mailbox->msg_unread = 0;
++ mailbox->msg_flagged = 0;
++
++ snprintf (path, sizeof (path), "%s/new", mailbox->path);
++
++ if ((dirp = opendir (path)) == NULL)
++ {
++ mailbox->magic = 0;
++ return;
++ }
++
++ while ((de = readdir (dirp)) != NULL)
++ {
++ if (*de->d_name == '.')
++ continue;
++
++ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
++ mailbox->new = 1;
++ mailbox->msgcount++;
++ mailbox->msg_unread++;
++ }
++ }
++
++ closedir (dirp);
++ snprintf (path, sizeof (path), "%s/cur", mailbox->path);
++
++ if ((dirp = opendir (path)) == NULL)
++ {
++ mailbox->magic = 0;
++ return;
++ }
++
++ while ((de = readdir (dirp)) != NULL)
++ {
++ if (*de->d_name == '.')
++ continue;
++
++ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
++ mailbox->msgcount++;
++ if ((p = strstr (de->d_name, ":2,"))) {
++ if (!strchr (p + 3, 'T')) {
++ if (!strchr (p + 3, 'S'))
++ mailbox->msg_unread++;
++ if (strchr(p + 3, 'F'))
++ mailbox->msg_flagged++;
++ }
++ }
++ }
++ }
++
++ mailbox->sb_last_checked = time(NULL);
++ closedir (dirp);
++}
++
+ /* returns 1 if mailbox has new mail */
+ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
+ {
+@@ -368,7 +488,7 @@
+ else
+ statcheck = sb->st_mtime > sb->st_atime
+ || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime);
+- if (statcheck)
++ if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0))
+ {
+ if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
+ {
+@@ -388,6 +508,27 @@
+ return rc;
+ }
+
++/* update message counts for the sidebar */
++void buffy_mbox_update (BUFFY* mailbox, struct stat *sb)
++{
++ CONTEXT *ctx = NULL;
++
++ if(!option(OPTSIDEBAR))
++ return;
++ if(mailbox->sb_last_checked > sb->st_mtime && mailbox->msgcount != 0)
++ return; /* no check necessary */
++
++ ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
++ if(ctx)
++ {
++ mailbox->msgcount = ctx->msgcount;
++ mailbox->msg_unread = ctx->unread;
++ mailbox->msg_flagged = ctx->flagged;
++ mailbox->sb_last_checked = time(NULL);
++ mx_close_mailbox(ctx, 0);
++ }
++}
++
+ int mutt_buffy_check (int force)
+ {
+ BUFFY *tmp;
+@@ -461,17 +602,20 @@
+ {
+ case M_MBOX:
+ case M_MMDF:
++ buffy_mbox_update (tmp, &sb);
+ if (buffy_mbox_hasnew (tmp, &sb) > 0)
+ BuffyCount++;
+ break;
+
+ case M_MAILDIR:
++ buffy_maildir_update (tmp);
+ if (buffy_maildir_hasnew (tmp) > 0)
+ BuffyCount++;
+ break;
+
+ case M_MH:
+- mh_buffy(tmp);
++ mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked);
++ mh_buffy(tmp);
+ if (tmp->new)
+ BuffyCount++;
+ break;
*** mutt-1.5.23-orig/buffy.h 2014-03-12 11:03:44.000000000 -0500
--- mutt-1.5.23/buffy.h 2014-04-11 10:14:01.000000000 -0500
***************
@@ -300,19 +255,17 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
}
BUFFY;
-*** mutt-1.5.23-orig/color.c 2014-03-12 11:03:45.000000000 -0500
---- mutt-1.5.23/color.c 2014-04-11 10:14:01.000000000 -0500
-***************
-*** 93,98 ****
---- 93,100 ----
- { "bold", MT_COLOR_BOLD },
- { "underline", MT_COLOR_UNDERLINE },
- { "index", MT_COLOR_INDEX },
-+ { "sidebar_new", MT_COLOR_NEW },
-+ { "sidebar_flagged", MT_COLOR_FLAGGED },
- { NULL, 0 }
- };
-
+*** mutt-1.5.23-orig/color.c.orig 2015-08-30 19:06:38.000000000 +0200
+--- mutt-1.5.23/color.c 2015-09-10 09:34:06.000000000 +0200
+@@ -94,6 +94,8 @@
+ { "underline", MT_COLOR_UNDERLINE },
+ { "index", MT_COLOR_INDEX },
+ { "prompt", MT_COLOR_PROMPT },
++ { "sidebar_new", MT_COLOR_NEW },
++ { "sidebar_flagged", MT_COLOR_FLAGGED },
+ { NULL, 0 }
+ };
+
*** mutt-1.5.23-orig/compose.c 2014-03-12 11:03:45.000000000 -0500
--- mutt-1.5.23/compose.c 2014-04-12 12:15:56.000000000 -0500
***************
@@ -785,84 +738,86 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
#ifdef USE_IMAP
WHERE short ImapKeepalive;
WHERE short ImapPipelineDepth;
-*** mutt-1.5.23-orig/handler.c 2014-03-12 11:03:45.000000000 -0500
---- mutt-1.5.23/handler.c 2014-04-11 10:14:01.000000000 -0500
-***************
-*** 1599,1604 ****
---- 1599,1609 ----
- size_t tmplength = 0;
- int rc = 0;
-
-+ #ifdef HAVE_FMEMOPEN
-+ char *temp;
-+ size_t tempsize;
-+ #endif
-+
- int oflags = s->flags;
-
- /* first determine which handler to use to process this part */
-***************
-*** 1711,1716 ****
---- 1716,1729 ----
- {
- /* decode to a tempfile, saving the original destination */
- fp = s->fpout;
-+ #ifdef HAVE_FMEMOPEN
-+ if ((s->fpout = open_memstream(&temp, &tempsize)) == NULL)
-+ {
-+ mutt_error _("Unable to open memory stream!");
-+ dprint (1, (debugfile, "Can't open memory stream.\n"));
-+ goto bail;
-+ }
-+ #else
- mutt_mktemp (tempfile, sizeof (tempfile));
- if ((s->fpout = safe_fopen (tempfile, "w")) == NULL)
- {
-***************
-*** 1718,1723 ****
---- 1731,1737 ----
- dprint (1, (debugfile, "Can't open %s.\n", tempfile));
- goto bail;
- }
-+ #endif
- /* decoding the attachment changes the size and offset, so save a copy
- * of the "real" values now, and restore them after processing
- */
-***************
-*** 1746,1753 ****
---- 1760,1778 ----
- /* restore final destination and substitute the tempfile for input */
- s->fpout = fp;
- fp = s->fpin;
-+ #ifdef HAVE_FMEMOPEN
-+ if(tempsize)
-+ s->fpin = fmemopen(temp, tempsize, "r");
-+ else /* fmemopen cannot handle zero-length buffers */
-+ s->fpin = safe_fopen ("/dev/null", "r");
-+ if(s->fpin == NULL) {
-+ mutt_perror("failed to re-open memstream!");
-+ return (-1);
-+ }
-+ #else
- s->fpin = fopen (tempfile, "r");
- unlink (tempfile);
-+ #endif
-
- /* restore the prefix */
- s->prefix = savePrefix;
-***************
-*** 1773,1778 ****
---- 1798,1807 ----
-
- /* restore the original source stream */
- safe_fclose (&s->fpin);
-+ #ifdef HAVE_FMEMOPEN
-+ if(tempsize)
-+ FREE(&temp);
-+ #endif
- s->fpin = fp;
- }
- }
+*** mutt-1.5.23-orig/handler.c.orig 2015-09-10 09:34:53.000000000 +0200
+--- mutt-1.5.23/handler.c 2015-09-10 09:58:03.000000000 +0200
+@@ -1625,6 +1625,11 @@
+ int decode = 0;
+ int rc = 0;
+
++#ifdef HAVE_FMEMOPEN
++ char *temp;
++ size_t tempsize;
++#endif
++
+ fseeko (s->fpin, b->offset, 0);
+
+ /* see if we need to decode this part before processing it */
+@@ -1642,6 +1647,14 @@
+ {
+ /* decode to a tempfile, saving the original destination */
+ fp = s->fpout;
++#ifdef HAVE_FMEMOPEN
++ if ((s->fpout = open_memstream(&temp, &tempsize)) == NULL)
++ {
++ mutt_error _("Unable to open memory stream!");
++ dprint (1, (debugfile, "Can't open memory stream.\n"));
++ goto bail;
++ }
++#else
+ mutt_mktemp (tempfile, sizeof (tempfile));
+ if ((s->fpout = safe_fopen (tempfile, "w")) == NULL)
+ {
+@@ -1649,6 +1662,7 @@
+ dprint (1, (debugfile, "Can't open %s.\n", tempfile));
+ return -1;
+ }
++#endif
+ /* decoding the attachment changes the size and offset, so save a copy
+ * of the "real" values now, and restore them after processing
+ */
+@@ -1677,8 +1691,19 @@
+ /* restore final destination and substitute the tempfile for input */
+ s->fpout = fp;
+ fp = s->fpin;
++#ifdef HAVE_FMEMOPEN
++ if(tempsize)
++ s->fpin = fmemopen(temp, tempsize, "r");
++ else /* fmemopen cannot handle zero-length buffers */
++ s->fpin = safe_fopen ("/dev/null", "r");
++ if(s->fpin == NULL) {
++ mutt_perror("failed to re-open memstream!");
++ return (-1);
++ }
++#else
+ s->fpin = fopen (tempfile, "r");
+ unlink (tempfile);
++#endif
+
+ /* restore the prefix */
+ s->prefix = savePrefix;
+@@ -1704,9 +1729,14 @@
+
+ /* restore the original source stream */
+ safe_fclose (&s->fpin);
++#ifdef HAVE_FMEMOPEN
++ if(tempsize)
++ FREE(&temp);
++#endif
+ s->fpin = fp;
+ }
+ }
++ bail:
+ s->flags |= M_FIRSTDONE;
+
+ return rc;
+@@ -1743,6 +1773,7 @@
+ handler_t handler = NULL;
+ int rc = 0;
+
++
+ int oflags = s->flags;
+
+ /* first determine which handler to use to process this part */
*** mutt-1.5.23-orig/init.h 2014-03-12 11:06:17.000000000 -0500
--- mutt-1.5.23/init.h 2014-04-11 10:14:01.000000000 -0500
***************
@@ -1285,29 +1240,25 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt)
{
int fd;
-*** mutt-1.5.23-orig/mutt_curses.h 2014-03-12 11:03:45.000000000 -0500
---- mutt-1.5.23/mutt_curses.h 2014-04-11 10:14:01.000000000 -0500
-***************
-*** 64,69 ****
---- 64,70 ----
- #undef lines
- #endif /* lines */
-
-+ #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
- #define CLEARLINE(x) move(x,0), clrtoeol()
- #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
- #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
-***************
-*** 120,125 ****
---- 121,128 ----
- MT_COLOR_BOLD,
- MT_COLOR_UNDERLINE,
- MT_COLOR_INDEX,
-+ MT_COLOR_NEW,
-+ MT_COLOR_FLAGGED,
- MT_COLOR_MAX
- };
-
+*** mutt-1.5.23-orig/mutt_curses.h.orig 2015-08-30 19:06:38.000000000 +0200
+--- mutt-1.5.23/mutt_curses.h 2015-09-10 09:42:34.000000000 +0200
+@@ -64,6 +64,7 @@
+ #undef lines
+ #endif /* lines */
+
++#define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
+ #define CLEARLINE(x) move(x,0), clrtoeol()
+ #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
+ #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
+@@ -121,6 +122,8 @@
+ MT_COLOR_UNDERLINE,
+ MT_COLOR_INDEX,
+ MT_COLOR_PROMPT,
++ MT_COLOR_NEW,
++ MT_COLOR_FLAGGED,
+ MT_COLOR_MAX
+ };
+
*** mutt-1.5.23-orig/mutt_menu.h 2014-03-12 11:06:17.000000000 -0500
--- mutt-1.5.23/mutt_menu.h 2014-04-11 10:14:01.000000000 -0500
***************
diff --git a/mail/mutt/files/extra-patch-sidebar-nntp b/mail/mutt/files/extra-patch-sidebar-nntp
index 44393acbc92f..c78318cea6f9 100644
--- a/mail/mutt/files/extra-patch-sidebar-nntp
+++ b/mail/mutt/files/extra-patch-sidebar-nntp
@@ -1,281 +1,236 @@
Taken from http://lunar-linux.org/~tchan/mutt/patch-1.5.23.sidebar.20140412.txt
diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
-*** mutt-1.5.23-orig/buffy.c 2014-03-12 11:03:44.000000000 -0500
---- mutt-1.5.23/buffy.c 2014-04-12 15:33:54.000000000 -0500
-***************
-*** 161,166 ****
---- 161,209 ----
- }
- }
-
-+ static int buffy_compare_name(const void *a, const void *b) {
-+ const BUFFY *b1 = * (BUFFY * const *) a;
-+ const BUFFY *b2 = * (BUFFY * const *) b;
-+
-+ return mutt_strcoll(b1->path, b2->path);
-+ }
-+
-+ static BUFFY *buffy_sort(BUFFY *b)
-+ {
-+ BUFFY *tmp = b;
-+ int buffycount = 0;
-+ BUFFY **ary;
-+ int i;
-+
-+ if (!option(OPTSIDEBARSORT))
-+ return b;
-+
-+ for (; tmp != NULL; tmp = tmp->next)
-+ buffycount++;
-+
-+ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
-+
-+ tmp = b;
-+ for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
-+ ary[i] = tmp;
-+ }
-+
-+ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
-+
-+ for (i = 0; i < buffycount - 1; i++) {
-+ ary[i]->next = ary[i+1];
-+ }
-+ ary[buffycount - 1]->next = NULL;
-+ for (i = 1; i < buffycount; i++) {
-+ ary[i]->prev = ary[i-1];
-+ }
-+ ary[0]->prev = NULL;
-+
-+ tmp = ary[0];
-+ free(ary);
-+ return tmp;
-+ }
-+
- BUFFY *mutt_find_mailbox (const char *path)
- {
- BUFFY *tmp = NULL;
-***************
-*** 196,204 ****
---- 239,251 ----
- static BUFFY *buffy_new (const char *path)
- {
- BUFFY* buffy;
-+ char rp[PATH_MAX];
-+ char *r;
-
- buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
- strfcpy (buffy->path, path, sizeof (buffy->path));
-+ r = realpath(path, rp);
-+ strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath));
- buffy->next = NULL;
- buffy->magic = 0;
-
-***************
-*** 243,250 ****
- p = realpath (buf, f1);
- for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next))
- {
-! q = realpath ((*tmp)->path, f2);
-! if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0)
- {
- dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
- break;
---- 290,297 ----
- p = realpath (buf, f1);
- for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next))
- {
-! q = (*tmp)->realpath;
-! if (mutt_strcmp (p ? p : buf, q) == 0)
- {
- dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
- break;
-***************
-*** 282,287 ****
---- 329,335 ----
- else
- (*tmp)->size = 0;
- }
-+ Incoming = buffy_sort(Incoming);
- return 0;
- }
-
-***************
-*** 306,311 ****
---- 354,364 ----
- return 0;
- }
-
-+ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) {
-+ mailbox->new = 1;
-+ return 1;
-+ }
-+
- if ((dirp = opendir (path)) == NULL)
- {
- mailbox->magic = 0;
-***************
-*** 340,345 ****
---- 393,464 ----
- return rc;
- }
-
-+ /* update message counts for the sidebar */
-+ void buffy_maildir_update (BUFFY* mailbox)
-+ {
-+ char path[_POSIX_PATH_MAX];
-+ DIR *dirp;
-+ struct dirent *de;
-+ char *p;
-+
-+ if(!option(OPTSIDEBAR))
-+ return;
-+
-+ mailbox->msgcount = 0;
-+ mailbox->msg_unread = 0;
-+ mailbox->msg_flagged = 0;
-+
-+ snprintf (path, sizeof (path), "%s/new", mailbox->path);
-+
-+ if ((dirp = opendir (path)) == NULL)
-+ {
-+ mailbox->magic = 0;
-+ return;
-+ }
-+
-+ while ((de = readdir (dirp)) != NULL)
-+ {
-+ if (*de->d_name == '.')
-+ continue;
-+
-+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
-+ mailbox->new = 1;
-+ mailbox->msgcount++;
-+ mailbox->msg_unread++;
-+ }
-+ }
-+
-+ closedir (dirp);
-+ snprintf (path, sizeof (path), "%s/cur", mailbox->path);
-+
-+ if ((dirp = opendir (path)) == NULL)
-+ {
-+ mailbox->magic = 0;
-+ return;
-+ }
-+
-+ while ((de = readdir (dirp)) != NULL)
-+ {
-+ if (*de->d_name == '.')
-+ continue;
-+
-+ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
-+ mailbox->msgcount++;
-+ if ((p = strstr (de->d_name, ":2,"))) {
-+ if (!strchr (p + 3, 'T')) {
-+ if (!strchr (p + 3, 'S'))
-+ mailbox->msg_unread++;
-+ if (strchr(p + 3, 'F'))
-+ mailbox->msg_flagged++;
-+ }
-+ }
-+ }
-+ }
-+
-+ mailbox->sb_last_checked = time(NULL);
-+ closedir (dirp);
-+ }
-+
- /* returns 1 if mailbox has new mail */
- static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
- {
-***************
-*** 351,357 ****
- else
- statcheck = sb->st_mtime > sb->st_atime
- || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime);
-! if (statcheck)
- {
- if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
- {
---- 470,476 ----
- else
- statcheck = sb->st_mtime > sb->st_atime
- || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime);
-! if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0))
- {
- if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
- {
-***************
-*** 371,376 ****
---- 490,516 ----
- return rc;
- }
-
-+ /* update message counts for the sidebar */
-+ void buffy_mbox_update (BUFFY* mailbox, struct stat *sb)
-+ {
-+ CONTEXT *ctx = NULL;
-+
-+ if(!option(OPTSIDEBAR))
-+ return;
-+ if(mailbox->sb_last_checked > sb->st_mtime && mailbox->msgcount != 0)
-+ return; /* no check necessary */
-+
-+ ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
-+ if(ctx)
-+ {
-+ mailbox->msgcount = ctx->msgcount;
-+ mailbox->msg_unread = ctx->unread;
-+ mailbox->msg_flagged = ctx->flagged;
-+ mailbox->sb_last_checked = time(NULL);
-+ mx_close_mailbox(ctx, 0);
-+ }
-+ }
-+
- int mutt_buffy_check (int force)
- {
- BUFFY *tmp;
-***************
-*** 444,460 ****
- {
- case M_MBOX:
- case M_MMDF:
- if (buffy_mbox_hasnew (tmp, &sb) > 0)
- BuffyCount++;
- break;
-
- case M_MAILDIR:
- if (buffy_maildir_hasnew (tmp) > 0)
- BuffyCount++;
- break;
-
- case M_MH:
-! mh_buffy(tmp);
- if (tmp->new)
- BuffyCount++;
- break;
---- 584,603 ----
- {
- case M_MBOX:
- case M_MMDF:
-+ buffy_mbox_update (tmp, &sb);
- if (buffy_mbox_hasnew (tmp, &sb) > 0)
- BuffyCount++;
- break;
-
- case M_MAILDIR:
-+ buffy_maildir_update (tmp);
- if (buffy_maildir_hasnew (tmp) > 0)
- BuffyCount++;
- break;
-
- case M_MH:
-! mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked);
-! mh_buffy(tmp);
- if (tmp->new)
- BuffyCount++;
- break;
+*** mutt-1.5.23-orig/buffy.c.orig 2015-08-30 19:06:38.000000000 +0200
+--- mutt-1.5.23/buffy.c 2015-09-10 09:31:22.000000000 +0200
+@@ -161,6 +161,49 @@
+ }
+ }
+
++static int buffy_compare_name(const void *a, const void *b) {
++ const BUFFY *b1 = * (BUFFY * const *) a;
++ const BUFFY *b2 = * (BUFFY * const *) b;
++
++ return mutt_strcoll(b1->path, b2->path);
++}
++
++static BUFFY *buffy_sort(BUFFY *b)
++{
++ BUFFY *tmp = b;
++ int buffycount = 0;
++ BUFFY **ary;
++ int i;
++
++ if (!option(OPTSIDEBARSORT))
++ return b;
++
++ for (; tmp != NULL; tmp = tmp->next)
++ buffycount++;
++
++ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
++
++ tmp = b;
++ for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
++ ary[i] = tmp;
++ }
++
++ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
++
++ for (i = 0; i < buffycount - 1; i++) {
++ ary[i]->next = ary[i+1];
++ }
++ ary[buffycount - 1]->next = NULL;
++ for (i = 1; i < buffycount; i++) {
++ ary[i]->prev = ary[i-1];
++ }
++ ary[0]->prev = NULL;
++
++ tmp = ary[0];
++ free(ary);
++ return tmp;
++}
++
+ BUFFY *mutt_find_mailbox (const char *path)
+ {
+ BUFFY *tmp = NULL;
+@@ -196,9 +239,13 @@
+ static BUFFY *buffy_new (const char *path)
+ {
+ BUFFY* buffy;
++ char rp[PATH_MAX];
++ char *r;
+
+ buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
+ strfcpy (buffy->path, path, sizeof (buffy->path));
++ r = realpath(path, rp);
++ strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath));
+ buffy->next = NULL;
+ buffy->magic = 0;
+
+@@ -243,8 +290,8 @@
+ p = realpath (buf, f1);
+ for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next))
+ {
+- q = realpath ((*tmp)->path, f2);
+- if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0)
++ q = (*tmp)->realpath;
++ if (mutt_strcmp (p ? p : buf, q) == 0)
+ {
+ dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
+ break;
+@@ -282,6 +329,7 @@
+ else
+ (*tmp)->size = 0;
+ }
++ Incoming = buffy_sort(Incoming);
+ return 0;
+ }
+
+@@ -306,6 +354,11 @@
+ return 0;
+ }
+
++ if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) {
++ mailbox->new = 1;
++ return 1;
++ }
++
+ if ((dirp = opendir (path)) == NULL)
+ {
+ mailbox->magic = 0;
+@@ -357,6 +410,73 @@
+
+ return 0;
+ }
++
++/* update message counts for the sidebar */
++void buffy_maildir_update (BUFFY* mailbox)
++{
++ char path[_POSIX_PATH_MAX];
++ DIR *dirp;
++ struct dirent *de;
++ char *p;
++
++ if(!option(OPTSIDEBAR))
++ return;
++
++ mailbox->msgcount = 0;
++ mailbox->msg_unread = 0;
++ mailbox->msg_flagged = 0;
++
++ snprintf (path, sizeof (path), "%s/new", mailbox->path);
++
++ if ((dirp = opendir (path)) == NULL)
++ {
++ mailbox->magic = 0;
++ return;
++ }
++
++ while ((de = readdir (dirp)) != NULL)
++ {
++ if (*de->d_name == '.')
++ continue;
++
++ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
++ mailbox->new = 1;
++ mailbox->msgcount++;
++ mailbox->msg_unread++;
++ }
++ }
++
++ closedir (dirp);
++ snprintf (path, sizeof (path), "%s/cur", mailbox->path);
++
++ if ((dirp = opendir (path)) == NULL)
++ {
++ mailbox->magic = 0;
++ return;
++ }
++
++ while ((de = readdir (dirp)) != NULL)
++ {
++ if (*de->d_name == '.')
++ continue;
++
++ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
++ mailbox->msgcount++;
++ if ((p = strstr (de->d_name, ":2,"))) {
++ if (!strchr (p + 3, 'T')) {
++ if (!strchr (p + 3, 'S'))
++ mailbox->msg_unread++;
++ if (strchr(p + 3, 'F'))
++ mailbox->msg_flagged++;
++ }
++ }
++ }
++ }
++
++ mailbox->sb_last_checked = time(NULL);
++ closedir (dirp);
++}
++
+ /* returns 1 if mailbox has new mail */
+ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
+ {
+@@ -368,7 +488,7 @@
+ else
+ statcheck = sb->st_mtime > sb->st_atime
+ || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime);
+- if (statcheck)
++ if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0))
+ {
+ if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
+ {
+@@ -388,6 +508,27 @@
+ return rc;
+ }
+
++/* update message counts for the sidebar */
++void buffy_mbox_update (BUFFY* mailbox, struct stat *sb)
++{
++ CONTEXT *ctx = NULL;
++
++ if(!option(OPTSIDEBAR))
++ return;
++ if(mailbox->sb_last_checked > sb->st_mtime && mailbox->msgcount != 0)
++ return; /* no check necessary */
++
++ ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
++ if(ctx)
++ {
++ mailbox->msgcount = ctx->msgcount;
++ mailbox->msg_unread = ctx->unread;
++ mailbox->msg_flagged = ctx->flagged;
++ mailbox->sb_last_checked = time(NULL);
++ mx_close_mailbox(ctx, 0);
++ }
++}
++
+ int mutt_buffy_check (int force)
+ {
+ BUFFY *tmp;
+@@ -461,17 +602,20 @@
+ {
+ case M_MBOX:
+ case M_MMDF:
++ buffy_mbox_update (tmp, &sb);
+ if (buffy_mbox_hasnew (tmp, &sb) > 0)
+ BuffyCount++;
+ break;
+
+ case M_MAILDIR:
++ buffy_maildir_update (tmp);
+ if (buffy_maildir_hasnew (tmp) > 0)
+ BuffyCount++;
+ break;
+
+ case M_MH:
+- mh_buffy(tmp);
++ mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked);
++ mh_buffy(tmp);
+ if (tmp->new)
+ BuffyCount++;
+ break;
*** mutt-1.5.23-orig/buffy.h 2014-03-12 11:03:44.000000000 -0500
--- mutt-1.5.23/buffy.h 2014-04-11 10:14:01.000000000 -0500
***************
@@ -300,21 +255,19 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
}
BUFFY;
-*** mutt-1.5.23-orig/color.c 2014-03-12 11:03:45.000000000 -0500
---- mutt-1.5.23/color.c 2014-04-11 10:14:01.000000000 -0500
-***************
-*** 93,98 ****
---- 93,100 ----
- { "bold", MT_COLOR_BOLD },
- { "underline", MT_COLOR_UNDERLINE },
- { "index", MT_COLOR_INDEX },
-+ { "sidebar_new", MT_COLOR_NEW },
-+ { "sidebar_flagged", MT_COLOR_FLAGGED },
- { NULL, 0 }
- };
-
-*** mutt-1.5.23-orig/compose.c.orig 2014-04-13 09:37:15.000000000 +0200
---- mutt-1.5.23/compose.c 2014-04-13 09:41:42.000000000 +0200
+*** mutt-1.5.23-orig/color.c.orig 2015-08-30 19:06:38.000000000 +0200
+--- mutt-1.5.23/color.c 2015-09-10 09:34:06.000000000 +0200
+@@ -94,6 +94,8 @@
+ { "underline", MT_COLOR_UNDERLINE },
+ { "index", MT_COLOR_INDEX },
+ { "prompt", MT_COLOR_PROMPT },
++ { "sidebar_new", MT_COLOR_NEW },
++ { "sidebar_flagged", MT_COLOR_FLAGGED },
+ { NULL, 0 }
+ };
+
+*** mutt-1.5.23-orig/compose.c.orig 2015-09-10 19:24:26.000000000 +0200
+--- mutt-1.5.23/compose.c 2015-09-10 20:49:12.000000000 +0200
@@ -83,7 +83,7 @@
#define HDR_XOFFSET 14
@@ -333,8 +286,8 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
{
-@@ -176,7 +176,7 @@
- }
+@@ -179,7 +179,7 @@
+ addstr (_(" (OppEnc mode)"));
clrtoeol ();
- move (HDR_CRYPTINFO, 0);
@@ -342,7 +295,7 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
clrtoeol ();
if ((WithCrypto & APPLICATION_PGP)
-@@ -194,7 +194,7 @@
+@@ -204,7 +204,7 @@
&& (msg->security & ENCRYPT)
&& SmimeCryptAlg
&& *SmimeCryptAlg) {
@@ -351,7 +304,7 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
NONULL(SmimeCryptAlg));
}
}
-@@ -207,7 +207,7 @@
+@@ -217,7 +217,7 @@
int c;
char *t;
@@ -360,7 +313,7 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
if (!chain)
{
-@@ -222,7 +222,7 @@
+@@ -232,7 +232,7 @@
if (t && t[0] == '0' && t[1] == '\0')
t = "<random>";
@@ -369,7 +322,7 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
break;
addstr (NONULL(t));
-@@ -274,7 +274,7 @@
+@@ -284,7 +284,7 @@
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), addr, 1);
@@ -378,7 +331,7 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
mutt_paddstr (W, buf);
}
-@@ -292,21 +292,21 @@
+@@ -302,21 +302,21 @@
}
else
{
@@ -405,7 +358,7 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
mutt_paddstr (W, fcc);
if (WithCrypto)
-@@ -317,7 +317,7 @@
+@@ -327,7 +327,7 @@
#endif
SETCOLOR (MT_COLOR_STATUS);
@@ -414,7 +367,7 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
clrtoeol ();
NORMAL_COLOR;
-@@ -353,7 +353,7 @@
+@@ -363,7 +363,7 @@
/* redraw the expanded list so the user can see the result */
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), *addr, 1);
@@ -423,7 +376,7 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
mutt_paddstr (W, buf);
return 0;
-@@ -685,7 +685,7 @@
+@@ -705,7 +705,7 @@
if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
{
mutt_str_replace (&msg->env->subject, buf);
@@ -432,7 +385,7 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
if (msg->env->subject)
mutt_paddstr (W, msg->env->subject);
else
-@@ -703,7 +703,7 @@
+@@ -723,7 +723,7 @@
{
strfcpy (fcc, buf, fcclen);
mutt_pretty_mailbox (fcc, fcclen);
@@ -701,84 +654,86 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
#ifdef USE_IMAP
WHERE short ImapKeepalive;
WHERE short ImapPipelineDepth;
-*** mutt-1.5.23-orig/handler.c 2014-03-12 11:03:45.000000000 -0500
---- mutt-1.5.23/handler.c 2014-04-11 10:14:01.000000000 -0500
-***************
-*** 1599,1604 ****
---- 1599,1609 ----
- size_t tmplength = 0;
- int rc = 0;
-
-+ #ifdef HAVE_FMEMOPEN
-+ char *temp;
-+ size_t tempsize;
-+ #endif
-+
- int oflags = s->flags;
-
- /* first determine which handler to use to process this part */
-***************
-*** 1711,1716 ****
---- 1716,1729 ----
- {
- /* decode to a tempfile, saving the original destination */
- fp = s->fpout;
-+ #ifdef HAVE_FMEMOPEN
-+ if ((s->fpout = open_memstream(&temp, &tempsize)) == NULL)
-+ {
-+ mutt_error _("Unable to open memory stream!");
-+ dprint (1, (debugfile, "Can't open memory stream.\n"));
-+ goto bail;
-+ }
-+ #else
- mutt_mktemp (tempfile, sizeof (tempfile));
- if ((s->fpout = safe_fopen (tempfile, "w")) == NULL)
- {
-***************
-*** 1718,1723 ****
---- 1731,1737 ----
- dprint (1, (debugfile, "Can't open %s.\n", tempfile));
- goto bail;
- }
-+ #endif
- /* decoding the attachment changes the size and offset, so save a copy
- * of the "real" values now, and restore them after processing
- */
-***************
-*** 1746,1753 ****
---- 1760,1778 ----
- /* restore final destination and substitute the tempfile for input */
- s->fpout = fp;
- fp = s->fpin;
-+ #ifdef HAVE_FMEMOPEN
-+ if(tempsize)
-+ s->fpin = fmemopen(temp, tempsize, "r");
-+ else /* fmemopen cannot handle zero-length buffers */
-+ s->fpin = safe_fopen ("/dev/null", "r");
-+ if(s->fpin == NULL) {
-+ mutt_perror("failed to re-open memstream!");
-+ return (-1);
-+ }
-+ #else
- s->fpin = fopen (tempfile, "r");
- unlink (tempfile);
-+ #endif
-
- /* restore the prefix */
- s->prefix = savePrefix;
-***************
-*** 1773,1778 ****
---- 1798,1807 ----
-
- /* restore the original source stream */
- safe_fclose (&s->fpin);
-+ #ifdef HAVE_FMEMOPEN
-+ if(tempsize)
-+ FREE(&temp);
-+ #endif
- s->fpin = fp;
- }
- }
+*** mutt-1.5.23-orig/handler.c.orig 2015-09-10 09:34:53.000000000 +0200
+--- mutt-1.5.23/handler.c 2015-09-10 09:58:03.000000000 +0200
+@@ -1625,6 +1625,11 @@
+ int decode = 0;
+ int rc = 0;
+
++#ifdef HAVE_FMEMOPEN
++ char *temp;
++ size_t tempsize;
++#endif
++
+ fseeko (s->fpin, b->offset, 0);
+
+ /* see if we need to decode this part before processing it */
+@@ -1642,6 +1647,14 @@
+ {
+ /* decode to a tempfile, saving the original destination */
+ fp = s->fpout;
++#ifdef HAVE_FMEMOPEN
++ if ((s->fpout = open_memstream(&temp, &tempsize)) == NULL)
++ {
++ mutt_error _("Unable to open memory stream!");
++ dprint (1, (debugfile, "Can't open memory stream.\n"));
++ goto bail;
++ }
++#else
+ mutt_mktemp (tempfile, sizeof (tempfile));
+ if ((s->fpout = safe_fopen (tempfile, "w")) == NULL)
+ {
+@@ -1649,6 +1662,7 @@
+ dprint (1, (debugfile, "Can't open %s.\n", tempfile));
+ return -1;
+ }
++#endif
+ /* decoding the attachment changes the size and offset, so save a copy
+ * of the "real" values now, and restore them after processing
+ */
+@@ -1677,8 +1691,19 @@
+ /* restore final destination and substitute the tempfile for input */
+ s->fpout = fp;
+ fp = s->fpin;
++#ifdef HAVE_FMEMOPEN
++ if(tempsize)
++ s->fpin = fmemopen(temp, tempsize, "r");
++ else /* fmemopen cannot handle zero-length buffers */
++ s->fpin = safe_fopen ("/dev/null", "r");
++ if(s->fpin == NULL) {
++ mutt_perror("failed to re-open memstream!");
++ return (-1);
++ }
++#else
+ s->fpin = fopen (tempfile, "r");
+ unlink (tempfile);
++#endif
+
+ /* restore the prefix */
+ s->prefix = savePrefix;
+@@ -1704,9 +1729,14 @@
+
+ /* restore the original source stream */
+ safe_fclose (&s->fpin);
++#ifdef HAVE_FMEMOPEN
++ if(tempsize)
++ FREE(&temp);
++#endif
+ s->fpin = fp;
+ }
+ }
++ bail:
+ s->flags |= M_FIRSTDONE;
+
+ return rc;
+@@ -1743,6 +1773,7 @@
+ handler_t handler = NULL;
+ int rc = 0;
+
++
+ int oflags = s->flags;
+
+ /* first determine which handler to use to process this part */
*** mutt-1.5.23-orig/init.h 2014-03-12 11:06:17.000000000 -0500
--- mutt-1.5.23/init.h 2014-04-11 10:14:01.000000000 -0500
***************
@@ -1201,29 +1156,25 @@ diff -uNp -r mutt-1.5.22.orig/buffy.c mutt-1.5.22/buffy.c
static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt)
{
int fd;
-*** mutt-1.5.23-orig/mutt_curses.h 2014-03-12 11:03:45.000000000 -0500
---- mutt-1.5.23/mutt_curses.h 2014-04-11 10:14:01.000000000 -0500
-***************
-*** 64,69 ****
---- 64,70 ----
- #undef lines
- #endif /* lines */
-
-+ #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
- #define CLEARLINE(x) move(x,0), clrtoeol()
- #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
- #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
-***************
-*** 120,125 ****
---- 121,128 ----
- MT_COLOR_BOLD,
- MT_COLOR_UNDERLINE,
- MT_COLOR_INDEX,
-+ MT_COLOR_NEW,
-+ MT_COLOR_FLAGGED,
- MT_COLOR_MAX
- };
-
+*** mutt-1.5.23-orig/mutt_curses.h.orig 2015-08-30 19:06:38.000000000 +0200
+--- mutt-1.5.23/mutt_curses.h 2015-09-10 09:42:34.000000000 +0200
+@@ -64,6 +64,7 @@
+ #undef lines
+ #endif /* lines */
+
++#define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
+ #define CLEARLINE(x) move(x,0), clrtoeol()
+ #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
+ #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
+@@ -121,6 +122,8 @@
+ MT_COLOR_UNDERLINE,
+ MT_COLOR_INDEX,
+ MT_COLOR_PROMPT,
++ MT_COLOR_NEW,
++ MT_COLOR_FLAGGED,
+ MT_COLOR_MAX
+ };
+
*** mutt-1.5.23-orig/mutt_menu.h 2014-03-12 11:06:17.000000000 -0500
--- mutt-1.5.23/mutt_menu.h 2014-04-11 10:14:01.000000000 -0500
***************
diff --git a/mail/mutt/files/extra-patch-trash-purge b/mail/mutt/files/extra-patch-trash-purge
index d609d184d907..89d46c574167 100644
--- a/mail/mutt/files/extra-patch-trash-purge
+++ b/mail/mutt/files/extra-patch-trash-purge
@@ -147,16 +147,16 @@ diff -pruN -x'*.orig' mutt-1.5.20/functions.h mutt-1.5.20-trash/functions.h
{ "exit", OP_EXIT, "q" },
{ "reply", OP_REPLY, "r" },
diff -pruN -x'*.orig' mutt-1.5.20/globals.h mutt-1.5.20-trash/globals.h
---- mutt-1.5.20/globals.h 2009-06-03 16:48:31.000000000 -0400
-+++ mutt-1.5.20-trash/globals.h 2009-07-23 09:44:40.000000000 -0400
-@@ -139,6 +139,7 @@ WHERE char *StChars;
+--- mutt-1.5.24/globals.h.orig 2015-08-30 19:06:38.000000000 +0200
++++ mutt-1.5.20-trash/globals.h 2015-09-10 09:26:21.000000000 +0200
+@@ -141,6 +141,7 @@
WHERE char *Status;
WHERE char *Tempdir;
WHERE char *Tochars;
+WHERE char *TrashPath;
- WHERE char *Username;
- WHERE char *Visual;
-
+ WHERE char *TSStatusFormat;
+ WHERE char *TSIconFormat;
+ WHERE short TSSupported;
diff -pruN -x'*.orig' mutt-1.5.20/imap/message.c mutt-1.5.20-trash/imap/message.c
--- mutt-1.5.20/imap/message.c 2009-06-07 13:52:57.000000000 -0400
+++ mutt-1.5.20-trash/imap/message.c 2009-07-23 09:44:40.000000000 -0400
diff --git a/mail/mutt/files/patch-CVE-2014-9116 b/mail/mutt/files/patch-CVE-2014-9116
deleted file mode 100644
index 830d606bfbe6..000000000000
--- a/mail/mutt/files/patch-CVE-2014-9116
+++ /dev/null
@@ -1,43 +0,0 @@
-# HG changeset patch
-# User Kevin McCarthy <kevin@8t8.us>
-# Date 1417472364 28800
-# Mon Dec 01 14:19:24 2014 -0800
-# Branch stable
-# Node ID 54c59aaf88b9f6b50f1078fc6f7551fa9315ac3e
-# Parent 1b583341d5ad677c8a1935eb4110eba27606878a
-Revert write_one_header() to skip space and tab. (closes #3716)
-
-This patch fixes CVE-2014-9116 in the stable branch. It reverts
-write_one_header() to the pre [f251d523ca5a] code for skipping
-whitespace.
-
-Thanks to Antonio Radici and Tomas Hoger for their analysis and patches
-to mutt, which this patch is based off of.
-
-diff --git a/sendlib.c b/sendlib.c
---- sendlib.c
-+++ sendlib.c
-@@ -1809,17 +1809,22 @@
- {
- tagbuf = NULL;
- valbuf = mutt_substrdup (start, end);
- }
- else
- {
- tagbuf = mutt_substrdup (start, t);
- /* skip over the colon separating the header field name and value */
-- t = skip_email_wsp(t + 1);
-+ ++t;
-+
-+ /* skip over any leading whitespace (WSP, as defined in RFC5322) */
-+ while (*t == ' ' || *t == '\t')
-+ t++;
-+
- valbuf = mutt_substrdup (t, end);
- }
- dprint(4,(debugfile,"mwoh: buf[%s%s] too long, "
- "max width = %d > %d\n",
- NONULL(pfx), valbuf, max, wraplen));
- if (fold_one_header (fp, tagbuf, valbuf, pfx, wraplen, flags) < 0)
- return -1;
- FREE (&tagbuf);
diff --git a/mail/mutt/files/patch-Makefile.am b/mail/mutt/files/patch-Makefile.am
index 6eda940b2f61..d9f71ab4a834 100644
--- a/mail/mutt/files/patch-Makefile.am
+++ b/mail/mutt/files/patch-Makefile.am
@@ -1,18 +1,9 @@
---- Makefile.am.orig 2014-03-12 17:03:44.000000000 +0100
-+++ Makefile.am 2014-03-16 17:22:07.000000000 +0100
-@@ -97,7 +97,7 @@
-
- # If this fails, we will fall back to the implementation in txt2c.sh
- txt2c: txt2c.c
-- -$${NATIVECC-$(CC)} -o $@ $<
-+ -$(CC) -o $@ $<
-
- conststrings.c: txt2c config.status
- ( \
+--- Makefile.am.orig 2015-09-10 07:37:42.000000000 +0200
++++ Makefile.am 2015-09-10 07:38:51.000000000 +0200
@@ -162,10 +162,6 @@
install-data-local:
- $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)
- $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir)/mime.types.dist
- -if [ ! -f $(DESTDIR)$(sysconfdir)/mime.types ]; then \
- $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir); \
diff --git a/mail/mutt/files/patch-curs_lib.c b/mail/mutt/files/patch-curs_lib.c
deleted file mode 100644
index bfbb5aa3ab9b..000000000000
--- a/mail/mutt/files/patch-curs_lib.c
+++ /dev/null
@@ -1,43 +0,0 @@
---- curs_lib.c.old Wed Sep 1 19:39:20 1999
-+++ curs_lib.c Sun Sep 26 23:47:03 1999
-@@ -156,6 +156,16 @@
- def = 0;
- break;
- }
-+ else if (tolower(ch.ch) == 'y')
-+ {
-+ def = 1;
-+ break;
-+ }
-+ else if (tolower(ch.ch) == 'n')
-+ {
-+ def = 0;
-+ break;
-+ }
- else
- {
- BEEP();
-@@ -413,8 +423,9 @@
- {
- event_t ch;
- int choice;
-- char *p;
-+ char *p, *nletters;
-
-+ nletters = _(letters);
- mvaddstr (LINES - 1, 0, prompt);
- clrtoeol ();
- FOREVER
-@@ -428,6 +439,12 @@
- }
- else
- {
-+ p = strchr (nletters, ch.ch);
-+ if (p)
-+ {
-+ choice = p - nletters + 1;
-+ break;
-+ }
- p = strchr (letters, ch.ch);
- if (p)
- {
diff --git a/mail/mutt/files/patch-examples b/mail/mutt/files/patch-examples
index a2c8815720db..bf2e100161a8 100644
--- a/mail/mutt/files/patch-examples
+++ b/mail/mutt/files/patch-examples
@@ -1,26 +1,26 @@
---- contrib/Makefile.am.orig Tue Jul 18 20:04:14 2006
-+++ contrib/Makefile.am Wed Aug 30 16:05:33 2006
+--- contrib/Makefile.am.orig 2015-09-10 08:43:38.000000000 +0200
++++ contrib/Makefile.am 2015-09-10 08:48:05.000000000 +0200
@@ -1,6 +1,7 @@
- # $Id: Makefile.am,v 3.1 2006/07/18 18:04:14 brendan Exp $
+ # $Id$
subdir = contrib
+samplesdir = @samplesdir@
- SAMPLES = Mush.rc Pine.rc gpg.rc pgp2.rc pgp5.rc pgp6.rc Tin.rc \
+ SAMPLES = Mush.rc Pine.rc gpg.rc pgp2.rc pgp6.rc Tin.rc \
sample.muttrc sample.mailcap sample.muttrc-tlr \
@@ -14,12 +15,12 @@
iconv/make.sh
install-data-local:
-- $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)/samples $(DESTDIR)$(docdir)/samples/iconv
-+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(samplesdir) $(DESTDIR)$(samplesdir)/iconv
+- $(MKDIR_P) $(DESTDIR)$(docdir)/samples $(DESTDIR)$(docdir)/samples/iconv
++ $(MKDIR_P) $(DESTDIR)$(samplesdir) $(DESTDIR)$(samplesdir)/iconv
for f in $(SAMPLES) ; do \
- $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir)/samples ; \
+ $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(samplesdir) ; \
done
for f in $(srcdir)/iconv/*.rc ; do \
- $(INSTALL) -m 644 $$f $(DESTDIR)$(docdir)/samples/iconv ; \
-+ $(INSTALL) -m 644 $$f $(DESTDIR)$(samplesdir)/iconv ; \
++ $(INSTALL) -m 644 $$f $(DESTDIR)$(samplesdir)/iconv ; \
done
uninstall-local:
@@ -68,42 +68,38 @@
into your system's global Muttrc, which normally resides in /etc or
/usr/local/etc.
---- doc/manual.txt.orig 2009-06-14 20:54:56.000000000 +0200
-+++ doc/manual.txt 2009-06-22 15:11:26.000000000 +0200
-@@ -3225,9 +3225,9 @@
- shows that arguments can be quoted: the script will receive the expanded string
- between the single quotes as the only argument.
-
--A practical example is the mutt_xtitle script installed in the samples
--subdirectory of the Mutt documentation: it can be used as filter for
--$status_format to set the current terminal's title, if supported.
-+A practical example is the mutt_xtitle script installed in the
-+share/examples/mutt/ subdirectory of the Mutt documentation: it can be used as
-+filter for $status_format to set the current terminal's title, if supported.
+--- doc/manual.txt.orig 2015-08-30 19:25:51.000000000 +0200
++++ doc/manual.txt 2015-09-10 08:56:32.000000000 +0200
+@@ -3128,8 +3128,8 @@
+ argument.
+
+ A practical example is the mutt_xtitle script installed in the samples
+- subdirectory of the Mutt documentation: it can be used as filter for
+- $$ssttaattuuss__ffoorrmmaatt to set the current terminal's title, if supported.
++ share/examples/mutt subdirectory of the Mutt documentation: it can be used as
++ filter for $$ssttaattuuss__ffoorrmmaatt to set the current terminal's title, if supported.
29.4. Padding
-@@ -7740,8 +7740,8 @@
+@@ -7736,8 +7736,8 @@
- For examples on how to configure these formats for the various versions of PGP
- which are floating around, see the pgp and gpg sample configuration files in
--the samples/ subdirectory which has been installed on your system alongside the
--documentation. (PGP only)
-+the share/examples/mutt/ subdirectory which has been installed on your system.
-+(PGP only)
+ For examples on how to configure these formats for the various versions
+ of PGP which are floating around, see the pgp and gpg sample
+- configuration files in the samples/ subdirectory which has been
+- installed on your system alongside the documentation. (PGP only)
++ configuration files in the share/examples/mutt/ subdirectory which has
++ been installed on your system alongside the documentation. (PGP only)
- 3.158. pgp_decrypt_command
+ 3.162. pgp_decrypt_command
-@@ -8751,9 +8751,9 @@
- | |$smime_ca_location?. |
- +-----------------------------------------------------------------------------+
+@@ -8783,8 +8783,8 @@
+ "-CAfile $$ssmmiimmee__ccaa__llooccaattiioonn".
--For examples on how to configure these formats, see the smime.rc in the samples
--/ subdirectory which has been installed on your system alongside the
--documentation. (S/MIME only)
-+For examples on how to configure these formats, see the smime.rc in the
-+share/examples/mutt/ subdirectory which has been installed on your system.
-+(S/MIME only)
+ For examples on how to configure these formats, see the smime.rc in the
+- samples/ subdirectory which has been installed on your system alongside
+- the documentation. (S/MIME only)
++ share/examples/mutt/ subdirectory which has been installed on your system
++ alongside the documentation. (S/MIME only)
- 3.244. smime_decrypt_use_default_key
+ 3.252. smime_decrypt_use_default_key
diff --git a/mail/mutt/files/patch-gpg_agent_info b/mail/mutt/files/patch-gpg_agent_info
deleted file mode 100644
index 5e1258032fa3..000000000000
--- a/mail/mutt/files/patch-gpg_agent_info
+++ /dev/null
@@ -1,95 +0,0 @@
-# HG changeset patch
-# User Kevin McCarthy <kevin@8t8.us>
-# Date 1422238196 28800
-# Node ID df55f14f45858193a4cc506065ae2c6989138c2e
-# Parent a0a5e505463e9db9b365e244452eab7301c1827c
-Remove GPG_AGENT_INFO check for GnuPG 2.1 compatibility. (closes #3715)
-
-GnuPG version 2.1 stops exporting the GPG_AGENT_INFO environment
-variable, so mutt can't check for the presence of that to ensure the
-agent is running.
-
-For GPGME, we can check for the OpenPGP protocol being present. For
-classic pgp, we have to trust the user setting.
-
-This patch is based on the patches sent by CustaiCo and muffins. Thank
-you both for reporting the problem and creating a patch.
-
-diff -r a0a5e505463e -r df55f14f4585 crypt-gpgme.c
---- crypt-gpgme.c Tue Jan 27 00:52:02 2015 +0100
-+++ crypt-gpgme.c Sun Jan 25 18:09:56 2015 -0800
-@@ -4548,27 +4548,36 @@
- }
- }
-
--/* Initialization. */
--static void init_gpgme (void)
-+static void init_pgp (void)
- {
-- /* Make sure that gpg-agent is running. */
-- if (! getenv ("GPG_AGENT_INFO"))
-- {
-- mutt_error (_("\nUsing GPGME backend, although no gpg-agent is running"));
-- if (mutt_any_key_to_continue (NULL) == -1)
-- mutt_exit(1);
-- }
-+ if (gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP) != GPG_ERR_NO_ERROR)
-+ {
-+ mutt_error (_("GPGME: OpenPGP protocol not available"));
-+ if (mutt_any_key_to_continue (NULL) == -1)
-+ mutt_exit(1);
-+ }
-+}
-+
-+static void init_smime (void)
-+{
-+ if (gpgme_engine_check_version (GPGME_PROTOCOL_CMS) != GPG_ERR_NO_ERROR)
-+ {
-+ mutt_error (_("GPGME: CMS protocol not available"));
-+ if (mutt_any_key_to_continue (NULL) == -1)
-+ mutt_exit(1);
-+ }
- }
-
- void pgp_gpgme_init (void)
- {
-- init_common();
-- init_gpgme ();
-+ init_common ();
-+ init_pgp ();
- }
-
- void smime_gpgme_init (void)
- {
-- init_common();
-+ init_common ();
-+ init_smime ();
- }
-
- static int gpgme_send_menu (HEADER *msg, int *redraw, int is_smime)
-diff -r a0a5e505463e -r df55f14f4585 init.h
---- init.h Tue Jan 27 00:52:02 2015 +0100
-+++ init.h Sun Jan 25 18:09:56 2015 -0800
-@@ -1970,6 +1970,8 @@
- /*
- ** .pp
- ** If \fIset\fP, mutt will use a possibly-running \fCgpg-agent(1)\fP process.
-+ ** Note that as of version 2.1, GnuPG no longer exports GPG_AGENT_INFO, so
-+ ** mutt no longer verifies if the agent is running.
- ** (PGP only)
- */
- { "pgp_verify_command", DT_STR, R_NONE, UL &PgpVerifyCommand, 0},
-diff -r a0a5e505463e -r df55f14f4585 pgp.c
---- pgp.c Tue Jan 27 00:52:02 2015 +0100
-+++ pgp.c Sun Jan 25 18:09:56 2015 -0800
-@@ -108,7 +108,8 @@
- {
- char *tty;
-
-- if (!option (OPTUSEGPGAGENT) || !getenv ("GPG_AGENT_INFO"))
-+ /* GnuPG 2.1 no longer exports GPG_AGENT_INFO */
-+ if (!option (OPTUSEGPGAGENT))
- return 0;
-
- if ((tty = ttyname(0)))
-
diff --git a/mail/mutt/files/patch-mktemp b/mail/mutt/files/patch-mktemp
index 16521f758607..ea344c679986 100644
--- a/mail/mutt/files/patch-mktemp
+++ b/mail/mutt/files/patch-mktemp
@@ -1,11 +1,13 @@
---- muttlib.c.orig 2010-09-19 09:58:24.000000000 +0200
-+++ muttlib.c 2010-09-19 10:36:26.000000000 +0200
-@@ -788,14 +788,15 @@
-
- void _mutt_mktemp (char *s, size_t slen, const char *src, int line)
+--- muttlib.c.orig 2015-09-10 08:59:45.000000000 +0200
++++ muttlib.c 2015-09-10 09:04:24.000000000 +0200
+@@ -774,16 +774,15 @@
+ void _mutt_mktemp (char *s, size_t slen, const char *prefix, const char *suffix,
+ const char *src, int line)
{
-- size_t n = snprintf (s, slen, "%s/mutt-%s-%d-%d-%ld%ld", NONULL (Tempdir), NONULL (Hostname),
-- (int) getuid (), (int) getpid (), random (), random ());
+- size_t n = snprintf (s, slen, "%s/%s-%s-%d-%d-%ld%ld%s%s",
+- NONULL (Tempdir), NONULL (prefix), NONULL (Hostname),
+- (int) getuid (), (int) getpid (), random (), random (),
+- suffix ? "." : "", NONULL (suffix));
+ size_t n = snprintf (s, slen, "%s/mutt-%s-XXXXXXXX", NONULL (Tempdir), NONULL (Hostname));
if (n >= slen)
dprint (1, (debugfile, "%s:%d: ERROR: insufficient buffer space to hold temporary filename! slen=%zu but need %zu\n",
diff --git a/mail/mutt/files/patch-pgpkey.c b/mail/mutt/files/patch-pgpkey.c
deleted file mode 100644
index ea37f2880267..000000000000
--- a/mail/mutt/files/patch-pgpkey.c
+++ /dev/null
@@ -1,18 +0,0 @@
---- pgpkey.c.orig 2014-03-12 17:03:44.000000000 +0100
-+++ pgpkey.c 2015-04-13 17:50:05.000000000 +0200
-@@ -985,13 +985,13 @@
- pgp_remove_key (&matches, k);
-
- pgp_free_key (&matches);
-- if (!p[l-1])
-+ if (l && !p[l-1])
- p[l-1] = '!';
- return k;
- }
-
- out:
-- if (!p[l-1])
-+ if (l && !p[l-1])
- p[l-1] = '!';
- return NULL;
- }
diff --git a/mail/mutt/files/patch-smime-self b/mail/mutt/files/patch-smime-self
index d8b0e7b8d336..124abea594fd 100644
--- a/mail/mutt/files/patch-smime-self
+++ b/mail/mutt/files/patch-smime-self
@@ -22,10 +22,10 @@ Base: http://descolada.dartmouth.edu/mutt/patch-1.5.4+-ow.smime-encrypt-self.2
{
/* signed ? free it! */
return (-1);
---- init.h.orig 2009-02-06 13:43:14.000000000 +0100
-+++ init.h 2009-02-06 13:46:53.000000000 +0100
-@@ -1957,6 +1957,11 @@
- ** not used.
+--- init.h.orig 2015-09-10 09:06:48.000000000 +0200
++++ init.h 2015-09-10 09:08:24.000000000 +0200
+@@ -2748,6 +2748,11 @@
+ ** possible \fCprintf(3)\fP-like sequences.
** (S/MIME only)
*/
+ { "smime_encrypt_self", DT_QUAD, R_NONE, OPT_SMIMEENCRYPTSELF, 1 },
@@ -33,7 +33,7 @@ Base: http://descolada.dartmouth.edu/mutt/patch-1.5.4+-ow.smime-encrypt-self.2
+ ** .pp
+ ** Encrypt the message to smime_default_key too.
+ */
- { "smime_encrypt_with", DT_STR, R_NONE, UL &SmimeCryptAlg, 0 },
+ { "smime_encrypt_with", DT_STR, R_NONE, UL &SmimeCryptAlg, UL "aes256" },
/*
** .pp
diff -u -d -b -B -r3.18 mutt.h
@@ -47,20 +47,19 @@ diff -u -d -b -B -r3.18 mutt.h
OPT_MFUPTO,
OPT_MIMEFWD,
OPT_MIMEFWDREST,
---- contrib/smime.rc.orig Sat Mar 2 13:11:35 2002
-+++ contrib/smime.rc Sat Oct 25 17:56:28 2003
-@@ -23,9 +23,12 @@
+--- contrib/smime.rc.orig 2015-08-30 19:06:38.000000000 +0200
++++ contrib/smime.rc 2015-09-10 09:14:20.000000000 +0200
+@@ -23,8 +23,12 @@
# The (default) keyfile for signing/decrypting. Uncomment the following
# line and replace the keyid with your own.
-set smime_default_key="12345678.0"
+# set smime_default_key="12345678.0"
+
+# Uncomment the following line in addition to the one above, if you want that
+# all encrypted messages are also encrypted with your default key.
+# set smime_encrypt_self = yes
-
--# Uncommen to make mutt ask what key to use when trying to decrypt a message.
-+# Uncomment to make mutt ask what key to use when trying to decrypt a message.
++
+ # Uncomment to make mutt ask what key to use when trying to decrypt a message.
# It will use the default key above (if that was set) else.
# unset smime_decrypt_use_default_key
-
diff --git a/mail/mutt/files/patch-smime-sender b/mail/mutt/files/patch-smime-sender
index a8a9cacf5559..1c34b135e9c0 100644
--- a/mail/mutt/files/patch-smime-sender
+++ b/mail/mutt/files/patch-smime-sender
@@ -37,18 +37,17 @@
OPTSDEFAULTDECRYPTKEY,
#endif
#ifdef HAVE_PGP
---- contrib/smime.rc.orig Sat Oct 25 17:57:35 2003
-+++ contrib/smime.rc Sat Oct 25 17:57:35 2003
-@@ -6,8 +6,11 @@
- # will be the default method unless the following option is set
- set smime_is_default
+--- contrib/smime.rc.orig 2015-09-10 09:16:17.000000000 +0200
++++ contrib/smime.rc 2015-09-10 09:18:18.000000000 +0200
+@@ -8,7 +8,10 @@
--# Uncoment this if you don't want to set labels for certificates you add.
-+# Uncomment this if you don't want to set labels for certificates you add.
+ # Uncomment this if you don't want to set labels for certificates you add.
# unset smime_ask_cert_label
-+
+-
++
+# Uncomment this if you don't want to check for sender's email address
+# set smime_dont_check_sender = yes
-
++
# Passphrase expiration
set smime_timeout=300
+
diff --git a/mail/mutt/files/patch-staging-Makefile.am b/mail/mutt/files/patch-staging-Makefile.am
index 55d84054a818..0fcb2723adb3 100644
--- a/mail/mutt/files/patch-staging-Makefile.am
+++ b/mail/mutt/files/patch-staging-Makefile.am
@@ -1,14 +1,18 @@
---- Makefile.am.orig 2013-12-20 12:47:32.000000000 +0100
-+++ Makefile.am 2013-12-20 12:52:38.000000000 +0100
-@@ -156,11 +156,6 @@
- rm -f $(DESTDIR)$(bindir)/mutt.dotlock ; \
- ln -sf $(DESTDIR)$(bindir)/mutt_dotlock $(DESTDIR)$(bindir)/mutt.dotlock ; \
- fi
-- if test -f $(DESTDIR)$(bindir)/mutt_dotlock && test x@DOTLOCK_GROUP@ != x ; then \
-- chgrp @DOTLOCK_GROUP@ $(DESTDIR)$(bindir)/mutt_dotlock && \
-- chmod @DOTLOCK_PERMISSION@ $(DESTDIR)$(bindir)/mutt_dotlock || \
+--- Makefile.am.orig 2015-09-10 09:19:15.000000000 +0200
++++ Makefile.am 2015-09-10 09:21:00.000000000 +0200
+@@ -150,15 +150,6 @@
+ $(srcdir)/patchlist.sh < $(srcdir)/PATCHES > patchlist.c
+
+ install-exec-hook:
+- if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/mutt_dotlock ; then \
+- rm -f $(DESTDIR)$(bindir)/mutt.dotlock ; \
+- ln -sf $(DESTDIR)$(bindir)/mutt_dotlock $(DESTDIR)$(bindir)/mutt.dotlock ; \
+- fi
+- if test -f $(DESTDIR)$(bindir)/mutt_dotlock && test x$(DOTLOCK_GROUP) != x ; then \
+- chgrp $(DOTLOCK_GROUP) $(DESTDIR)$(bindir)/mutt_dotlock && \
+- chmod $(DOTLOCK_PERMISSION) $(DESTDIR)$(bindir)/mutt_dotlock || \
- { echo "Can't fix mutt_dotlock's permissions! This is required to lock mailboxes in the mail spool directory." >&2 ; exit 1 ; } \
- fi
install-data-local:
- $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)