diff --git a/.mutt.metadata b/.mutt.metadata
new file mode 100644
index 0000000..4408e81
--- /dev/null
+++ b/.mutt.metadata
@@ -0,0 +1 @@
+a8475f2618ce5d5d33bff85c0affdf21ab1d76b9 SOURCES/mutt-1.5.21.tar.gz
diff --git a/README.md b/README.md
deleted file mode 100644
index 0e7897f..0000000
--- a/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-The master branch has no content
-
-Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6
-
-If you find this file in a distro specific branch, it means that no content has been checked in yet
diff --git a/SOURCES/mutt-1.5.13-nodotlock.patch b/SOURCES/mutt-1.5.13-nodotlock.patch
new file mode 100644
index 0000000..c4888f6
--- /dev/null
+++ b/SOURCES/mutt-1.5.13-nodotlock.patch
@@ -0,0 +1,10 @@
+--- mutt-1.5.13/configure.nodotlock 2007-02-06 15:14:03.000000000 +0100
++++ mutt-1.5.13/configure 2007-02-06 15:14:04.000000000 +0100
+@@ -12300,6 +12300,7 @@
+ {
+ struct stat s;
+
++ return 1;
+ stat ("$mutt_cv_mailpath", &s);
+ if (s.st_mode & S_IWGRP) exit (0);
+ exit (1);
diff --git a/SOURCES/mutt-1.5.18-manual.patch b/SOURCES/mutt-1.5.18-manual.patch
new file mode 100644
index 0000000..0230c18
--- /dev/null
+++ b/SOURCES/mutt-1.5.18-manual.patch
@@ -0,0 +1,12 @@
+diff -up mutt-1.5.18/doc/Makefile.in.manual mutt-1.5.18/doc/Makefile.in
+diff -up mutt-1.5.18/init.h.manual mutt-1.5.18/init.h
+--- mutt-1.5.18/init.h.manual 2008-01-30 05:26:50.000000000 +0100
++++ mutt-1.5.18/init.h 2008-05-19 11:05:02.000000000 +0200
+@@ -19,7 +19,6 @@
+
+ #ifdef _MAKEDOC
+ # include "config.h"
+-# include "doc/makedoc-defs.h"
+ #else
+ # include "sort.h"
+ #endif
diff --git a/SOURCES/mutt-1.5.18-muttrc.patch b/SOURCES/mutt-1.5.18-muttrc.patch
new file mode 100644
index 0000000..22d72b2
--- /dev/null
+++ b/SOURCES/mutt-1.5.18-muttrc.patch
@@ -0,0 +1,20 @@
+diff -up mutt-1.5.18/doc/Muttrc.head.muttrc mutt-1.5.18/doc/Muttrc.head
+--- mutt-1.5.18/doc/Muttrc.head.muttrc 2008-01-30 05:26:50.000000000 +0100
++++ mutt-1.5.18/doc/Muttrc.head 2008-05-19 10:58:21.000000000 +0200
+@@ -19,11 +19,15 @@ macro index,pager,attach,compose \cb "\
+
+ # Show documentation when pressing F1
+ macro generic,pager mutt
with no arguments will make Mutt attempt
+ to read your spool mailbox. However, it is possible to read other
+ mailboxes and to send messages from the command line as well.
+-
Table 9.1. Command line options
Option | Description |
---|---|
-A | expand an alias |
-a | attach a file to a message |
-b | specify a blind carbon-copy (BCC) address |
-c | specify a carbon-copy (Cc) address |
-D | print the value of all Mutt variables to stdout |
-e | specify a config command to be run after initialization files are read |
-f | specify a mailbox to load |
-F | specify an alternate file to read initialization commands |
-h | print help on command line options |
-H | specify a draft file from which to read a header and body |
-i | specify a file to include in a message composition |
-m | specify a default mailbox type |
-n | do not read the system Muttrc |
-p | recall a postponed message |
-Q | query a configuration variable |
-R | open mailbox in read-only mode |
-s | specify a subject (enclose in quotes if it contains spaces) |
-v | show version number and compile-time definitions |
-x | simulate the mailx(1) compose mode |
-y | show a menu containing the files specified by the mailboxes command |
-z | exit immediately if there are no messages in the mailbox |
-Z | open the first folder with new message, exit immediately if none |
++
Table 9.1. Command line options
Option | Description |
---|---|
-A | expand an alias |
-a | attach a file to a message |
-b | specify a blind carbon-copy (BCC) address |
-c | specify a carbon-copy (Cc) address |
-D | print the value of all Mutt variables to stdout |
-d | log debugging output to ~/.muttdebug0 if complied with +DEBUG (level can be 1-5) |
-e | specify a config command to be run after initialization files are read |
-f | specify a mailbox to load |
-F | specify an alternate file to read initialization commands |
-h | print help on command line options |
-H | specify a draft file from which to read a header and body |
-i | specify a file to include in a message composition |
-m | specify a default mailbox type |
-n | do not read the system Muttrc |
-p | recall a postponed message |
-Q | query a configuration variable |
-R | open mailbox in read-only mode |
-s | specify a subject (enclose in quotes if it contains spaces) |
-v | show version number and compile-time definitions |
-x | simulate the mailx(1) compose mode |
-y | show a menu containing the files specified by the mailboxes command |
-z | exit immediately if there are no messages in the mailbox |
-Z | open the first folder with new message, exit immediately if none |
+ To read messages in a mailbox +
mutt
[-nz
] [-F
+ muttrc
+diff -up mutt-1.5.21/doc/manual.txt.manhelp mutt-1.5.21/doc/manual.txt
+--- mutt-1.5.21/doc/manual.txt.manhelp 2013-05-20 17:01:07.935442207 +0200
++++ mutt-1.5.21/doc/manual.txt 2013-05-20 17:01:13.622442108 +0200
+@@ -6021,6 +6021,8 @@ Table 9.1. Command line options
+ |------+----------------------------------------------------------------------|
+ |-D |print the value of all Mutt variables to stdout |
+ |------+----------------------------------------------------------------------|
++|-d |log debugging output to ~/.muttdebug0 if complied with +DEBUG (1-5) |
++|------+----------------------------------------------------------------------|
+ |-e |specify a config command to be run after initialization files are read|
+ |------+----------------------------------------------------------------------|
+ |-f |specify a mailbox to load |
+diff -up mutt-1.5.21/doc/pgpewrap.man.manhelp mutt-1.5.21/doc/pgpewrap.man
+--- mutt-1.5.21/doc/pgpewrap.man.manhelp 2013-05-20 17:01:13.953442102 +0200
++++ mutt-1.5.21/doc/pgpewrap.man 2013-05-20 17:01:13.953442102 +0200
+@@ -0,0 +1,46 @@
++.\" -*-nroff-*-
++.\"
++.\" pgpewrap, a command line munging tool
++.\" Manpage Copyright (c) 2013 Honza Horak
++.\"
++.\" This program is free software; you can redistribute it and/or modify
++.\" it under the terms of the GNU General Public License as published by
++.\" the Free Software Foundation; either version 2 of the License, or
++.\" (at your option) any later version.
++.\"
++.\" This program is distributed in the hope that it will be useful,
++.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
++.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++.\" GNU General Public License for more details.
++.\"
++.\" You should have received a copy of the GNU General Public License
++.\" along with this program; if not, write to the Free Software
++.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++.\"
++.TH pgpewrap 1 "May 2013" Unix "User Manuals"
++.SH NAME
++pgpewrap \- Mutt command line munging tool
++
++.SH SYNTAX
++.PP
++\fBpgpewrap\fP [ \fBflags\fP ] \-\- \fBprefix\fP [ \fBrecipients\fP ]
++
++.SH DESCRIPTION
++.PP
++This is a little C program which does some command line munging: The
++first argument is a command to be executed. When \fBpgpewrap\fP
++encounters a "\-\-" (dash\-dash) argument, it will interpret the next
++argument as a prefix which is put in front of all following
++arguments.
++
++.SH EXAMPLE
++
++ pgpewrap pgpe file \-\- \-r a b c
++
++will execute:
++
++ pgpe file -r a -r b -r c
++
++This script is needed with PGP 5 and with GPG, since their command
++line interfaces can't be properly served by mutt's format mechanism.
++
+diff -up mutt-1.5.21/doc/PGP-Notes.txt.manhelp mutt-1.5.21/doc/PGP-Notes.txt
+--- mutt-1.5.21/doc/PGP-Notes.txt.manhelp 2008-03-19 21:07:06.000000000 +0100
++++ mutt-1.5.21/doc/PGP-Notes.txt 2013-05-20 17:01:14.335442095 +0200
+@@ -182,6 +182,10 @@ Command line options:
+
+ -s Dump the secret key ring.
+
++ -S Dump signatures.
++
++ -f Dump fingerprints.
++
+
+
+ 2. pgpewrap
+diff -up mutt-1.5.21/doc/pgpring.man.manhelp mutt-1.5.21/doc/pgpring.man
+--- mutt-1.5.21/doc/pgpring.man.manhelp 2013-05-20 17:01:14.685442089 +0200
++++ mutt-1.5.21/doc/pgpring.man 2013-05-20 17:01:14.685442089 +0200
+@@ -0,0 +1,58 @@
++.\" -*-nroff-*-
++.\"
++.\" pgpring, a key ring dumper
++.\" Manpage Copyright (c) 2004-2013 Matthew Wilcox, Honza Horak
++.\"
++.\" This program is free software; you can redistribute it and/or modify
++.\" it under the terms of the GNU General Public License as published by
++.\" the Free Software Foundation; either version 2 of the License, or
++.\" (at your option) any later version.
++.\"
++.\" This program is distributed in the hope that it will be useful,
++.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
++.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++.\" GNU General Public License for more details.
++.\"
++.\" You should have received a copy of the GNU General Public License
++.\" along with this program; if not, write to the Free Software
++.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++.\"
++.TH pgpring 1 "May 2013" Unix "User Manuals"
++.SH NAME
++pgpring \- Mutt key ring dumper
++
++.SH SYNTAX
++.PP
++\fBpgpring\fP [ \fB\-k\fP \fIkeyring\fP ] [ \fB\-2\fP | \fB\-5\fP ]
++[ \fB\-s\fP ] [ \fB\-S\fP ] [ \fB\-f\fP ]
++
++.SH DESCRIPTION
++.PP
++pgpring is a key ring dumper. It extracts information from PGP's
++binary key ring and emits it in an (almost) readable output format
++understood by mutt's key selection routines. This output format
++mimics the one used by the GNU Privacy Guard (GPG).
++
++.SH OPTIONS
++.TP
++.BI \-k " keyring"
++Dump the contents of the specified keyring.
++.TP
++.B \-2
++Use the default keyring for PGP 2.x.
++.TP
++.B \-5
++Use the default keyring for PGP 5.
++.TP
++.B \-s
++Dump the secret keyring.
++.TP
++.B \-S
++Dump signatures.
++.TP
++.B \-f
++Dump fingerprints.
++
++.SH AUTHORS
++Thomas Roessler mutt
with no arguments will make Mutt attempt
+ to read your spool mailbox. However, it is possible to read other
+ mailboxes and to send messages from the command line as well.
+-
Table 9.1. Command line options
Option | Description |
---|---|
-A | expand an alias |
-a | attach a file to a message |
-b | specify a blind carbon-copy (BCC) address |
-c | specify a carbon-copy (Cc) address |
-D | print the value of all Mutt variables to stdout |
-e | specify a config command to be run after initialization files are read |
-f | specify a mailbox to load |
-F | specify an alternate file to read initialization commands |
-h | print help on command line options |
-H | specify a draft file from which to read a header and body |
-i | specify a file to include in a message composition |
-m | specify a default mailbox type |
-n | do not read the system Muttrc |
-p | recall a postponed message |
-Q | query a configuration variable |
-R | open mailbox in read-only mode |
-s | specify a subject (enclose in quotes if it contains spaces) |
-v | show version number and compile-time definitions |
-x | simulate the mailx(1) compose mode |
-y | show a menu containing the files specified by the mailboxes command |
-z | exit immediately if there are no messages in the mailbox |
-Z | open the first folder with new message, exit immediately if none |
++
Table 9.1. Command line options
Option | Description |
---|---|
-A | expand an alias |
-a | attach a file to a message |
-b | specify a blind carbon-copy (BCC) address |
-c | specify a carbon-copy (Cc) address |
-D | print the value of all Mutt variables to stdout |
-d | log debugging output to ~/.muttdebug0 if complied with +DEBUG (level can be 1-5) |
-e | specify a config command to be run after initialization files are read |
-f | specify a mailbox to load |
-F | specify an alternate file to read initialization commands |
-h | print help on command line options |
-H | specify a draft file from which to read a header and body |
-i | specify a file to include in a message composition |
-m | specify a default mailbox type |
-n | do not read the system Muttrc |
-p | recall a postponed message |
-Q | query a configuration variable |
-R | open mailbox in read-only mode |
-s | specify a subject (enclose in quotes if it contains spaces) |
-v | show version number and compile-time definitions |
-x | simulate the mailx(1) compose mode |
-y | show a menu containing the files specified by the mailboxes command |
-z | exit immediately if there are no messages in the mailbox |
-Z | open the first folder with new message, exit immediately if none |
+ To read messages in a mailbox +
mutt
[-nz
] [-F
+ muttrc
+diff -up mutt-1.5.21/doc/Makefile.am.manhelp2 mutt-1.5.21/doc/Makefile.am
+--- mutt-1.5.21/doc/Makefile.am.manhelp2 2013-05-20 17:07:01.080436035 +0200
++++ mutt-1.5.21/doc/Makefile.am 2013-05-20 17:10:03.670432844 +0200
+@@ -13,6 +13,8 @@ EXTRA_DIST = dotlock.man \
+ smime_keys.man \
+ muttbug.man \
+ mutt.man \
++ pgpewrap.man \
++ pgpring.man \
+ PGP-Notes.txt \
+ applying-patches.txt \
+ devel-notes.txt \
+@@ -46,7 +48,7 @@ topsrcdir_DOCFILES = COPYRIGHT GPL INSTA
+
+ all: makedoc-all
+
+-makedoc-all: mutt.1 smime_keys.1 muttrc.man manual.html stamp-doc-rc stamp-doc-chunked manual.txt
++makedoc-all: mutt.1 smime_keys.1 muttrc.man manual.html stamp-doc-rc stamp-doc-chunked manual.txt pgpewrap.1 pgpring.1
+
+ install-data-local: makedoc-all instdoc
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
+@@ -54,6 +56,8 @@ install-data-local: makedoc-all instdoc
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
+ ./instdoc mutt.1 $(DESTDIR)$(mandir)/man1/mutt.1
+ ./instdoc smime_keys.1 $(DESTDIR)$(mandir)/man1/smime_keys.1
++ ./instdoc pgpewrap.1 $(DESTDIR)$(mandir)/man1/pgpewrap.1
++ ./instdoc pgpring.1 $(DESTDIR)$(mandir)/man1/pgpring.1
+ ./instdoc $(srcdir)/muttbug.man $(DESTDIR)$(mandir)/man1/flea.1
+ ./instdoc $(srcdir)/muttbug.man $(DESTDIR)$(mandir)/man1/muttbug.1
+ test x@DOTLOCK_TARGET@ = x || ./instdoc $(srcdir)/dotlock.man \
+@@ -82,7 +86,7 @@ install-data-local: makedoc-all instdoc
+ fi
+
+ uninstall-local:
+- for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 smime_keys.1; do \
++ for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 smime_keys.1 pgpewrap.1 pgpring.1; do \
+ rm -f $(DESTDIR)$(mandir)/man1/$$f ; \
+ done
+ for f in muttrc.5 mbox.5 mmdf.5 ; do \
+@@ -147,7 +151,7 @@ sortcheck: manual.xml
+ rm -rf vars.tmp.1 vars.tmp.2
+
+ clean-local:
+- rm -f *~ *.html *.orig *.rej stamp-doc-* *.ps mutt.1 smime_keys.1 muttrc.man
++ rm -f *~ *.html *.orig *.rej stamp-doc-* *.ps mutt.1 smime_keys.1 muttrc.man pgpewrap.1 pgpring.1
+ rm -f *.aux *.log *.tex *.out
+
+ DISTCLEANFILES=manual.txt manual.html manual.xml manual.pdf html \
+@@ -171,6 +175,12 @@ EDIT = sed -e 's,@sysconfdir\@,$(sysconf
+ mutt.1: $(srcdir)/mutt.man
+ $(EDIT) $(srcdir)/mutt.man > $@
+
++pgpewrap.1: $(srcdir)/pgpewrap.man
++ $(EDIT) $(srcdir)/pgpewrap.man > $@
++
++pgpring.1: $(srcdir)/pgpring.man
++ $(EDIT) $(srcdir)/pgpring.man > $@
++
+ smime_keys.1: $(srcdir)/smime_keys.man
+ $(EDIT) $(srcdir)/smime_keys.man > $@
+
diff --git a/SOURCES/mutt-1.5.21-notation.patch b/SOURCES/mutt-1.5.21-notation.patch
new file mode 100644
index 0000000..ebdbdca
--- /dev/null
+++ b/SOURCES/mutt-1.5.21-notation.patch
@@ -0,0 +1,13 @@
+diff -up mutt-1.5.21/crypt-gpgme.c.notation mutt-1.5.21/crypt-gpgme.c
+--- mutt-1.5.21/crypt-gpgme.c.notation 2012-04-25 10:26:20.589226791 +0200
++++ mutt-1.5.21/crypt-gpgme.c 2012-04-25 10:28:02.075915855 +0200
+@@ -72,7 +72,8 @@
+ #define xtoi_2(p) ((xtoi_1(p) * 16) + xtoi_1((p)+1))
+
+ #define PKA_NOTATION_NAME "pka-address@gnupg.org"
+-#define is_pka_notation(notation) (! strcmp ((notation)->name, \
++#define is_pka_notation(notation) ((notation)->name && \
++ ! strcmp ((notation)->name, \
+ PKA_NOTATION_NAME))
+
+ /* Values used for comparing addresses. */
diff --git a/SOURCES/mutt-1.5.21-pophash.patch b/SOURCES/mutt-1.5.21-pophash.patch
new file mode 100644
index 0000000..5540e97
--- /dev/null
+++ b/SOURCES/mutt-1.5.21-pophash.patch
@@ -0,0 +1,19 @@
+diff -up mutt/pop.c.pophash mutt/pop.c
+--- mutt/pop.c.pophash 2009-12-14 19:24:59.000000000 +0100
++++ mutt/pop.c 2011-10-04 16:51:23.307236908 +0200
+@@ -618,8 +618,15 @@ int pop_fetch_message (MESSAGE* msg, CON
+ }
+ rewind (msg->fp);
+ uidl = h->data;
++
++ /* we replace envelop, key in subj_hash has to be updated as well */
++ if (ctx->subj_hash && h->env->real_subj)
++ hash_delete (ctx->subj_hash, h->env->real_subj, h, NULL);
+ mutt_free_envelope (&h->env);
+ h->env = mutt_read_rfc822_header (msg->fp, h, 0, 0);
++ if (ctx->subj_hash && h->env->real_subj)
++ hash_insert (ctx->subj_hash, h->env->real_subj, h, 1);
++
+ h->data = uidl;
+ h->lines = 0;
+ fgets (buf, sizeof (buf), msg->fp);
diff --git a/SOURCES/mutt-1.5.21-syncdebug.patch b/SOURCES/mutt-1.5.21-syncdebug.patch
new file mode 100644
index 0000000..016e500
--- /dev/null
+++ b/SOURCES/mutt-1.5.21-syncdebug.patch
@@ -0,0 +1,12 @@
+diff -up mutt-1.5.21/imap/imap.c.syncdebug mutt-1.5.21/imap/imap.c
+--- mutt-1.5.21/imap/imap.c.syncdebug 2012-03-27 10:05:44.978962551 +0200
++++ mutt-1.5.21/imap/imap.c 2012-03-27 10:05:54.223252267 +0200
+@@ -1128,7 +1128,7 @@ static int sync_helper (IMAP_DATA* idata
+
+ char buf[LONG_STRING];
+
+- if (!mutt_bit_isset (idata->ctx->rights, right))
++ if (!idata->ctx || !mutt_bit_isset (idata->ctx->rights, right))
+ return 0;
+
+ if (right == M_ACL_WRITE && !imap_has_flag (idata->flags, name))
diff --git a/SOURCES/mutt-1.5.21-testcert.patch b/SOURCES/mutt-1.5.21-testcert.patch
new file mode 100644
index 0000000..0d0c86d
--- /dev/null
+++ b/SOURCES/mutt-1.5.21-testcert.patch
@@ -0,0 +1,30 @@
+diff -up mutt-1.5.21/mutt_ssl_gnutls.c.old mutt-1.5.21/mutt_ssl_gnutls.c
+--- mutt-1.5.21/mutt_ssl_gnutls.c.old 2011-03-23 11:46:28.760386765 +0100
++++ mutt-1.5.21/mutt_ssl_gnutls.c 2011-03-23 14:34:45.839456449 +0100
+@@ -978,6 +978,7 @@ static int tls_check_certificate (CONNEC
+ unsigned int cert_list_size = 0;
+ gnutls_certificate_status certstat;
+ int certerr, i, preauthrc, savedcert, rc = 0;
++ int rcpeer;
+
+ if (gnutls_auth_get_type (state) != GNUTLS_CRD_CERTIFICATE)
+ {
+@@ -1003,6 +1004,9 @@ static int tls_check_certificate (CONNEC
+ for (i = 0; i < cert_list_size; i++) {
+ rc = tls_check_preauth(&cert_list[i], certstat, conn->account.host, i,
+ &certerr, &savedcert);
++ if (i == 0)
++ rcpeer = rc;
++
+ preauthrc += rc;
+
+ if (savedcert)
+@@ -1028,7 +1032,7 @@ static int tls_check_certificate (CONNEC
+ dprint (1, (debugfile, "error trusting certificate %d: %d\n", i, rc));
+
+ certstat = tls_verify_peers (state);
+- if (!certstat)
++ if (!certstat && !rcpeer)
+ return 1;
+ }
+ }
diff --git a/SOURCES/mutt-1.5.21-tlsv1v2.patch b/SOURCES/mutt-1.5.21-tlsv1v2.patch
new file mode 100644
index 0000000..6e96f4c
--- /dev/null
+++ b/SOURCES/mutt-1.5.21-tlsv1v2.patch
@@ -0,0 +1,146 @@
+Some servers have problem when connection uses TLS 1.0 or SSL 3.0.
+Since openssl offers TLS 1.1 and 1.2, we would like to use these
+when connecting to server, while having ability to disable these
+protocols if needed.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=957840
+
+Upstream related bug report:
+http://dev.mutt.org/trac/ticket/3571
+
+diff -up mutt-1.5.21/init.h.tlsv1v2 mutt-1.5.21/init.h
+--- mutt-1.5.21/init.h.tlsv1v2 2013-06-27 12:46:14.120389035 +0200
++++ mutt-1.5.21/init.h 2013-06-27 12:47:28.020387743 +0200
+@@ -2970,6 +2970,18 @@ struct option_t MuttVars[] = {
+ ** This variable specifies whether to attempt to use TLSv1 in the
+ ** SSL authentication process.
+ */
++ { "ssl_use_tlsv1_1", DT_BOOL, R_NONE, OPTTLSV1_1, 1 },
++ /*
++ ** .pp
++ ** This variable specifies whether to attempt to use TLSv1.1 in the
++ ** SSL authentication process.
++ */
++ { "ssl_use_tlsv1_2", DT_BOOL, R_NONE, OPTTLSV1_2, 1 },
++ /*
++ ** .pp
++ ** This variable specifies whether to attempt to use TLSv1.2 in the
++ ** SSL authentication process.
++ */
+ #ifdef USE_SSL_OPENSSL
+ { "ssl_usesystemcerts", DT_BOOL, R_NONE, OPTSSLSYSTEMCERTS, 1 },
+ /*
+diff -up mutt-1.5.21/mutt.h.tlsv1v2 mutt-1.5.21/mutt.h
+--- mutt-1.5.21/mutt.h.tlsv1v2 2010-09-13 19:19:55.000000000 +0200
++++ mutt-1.5.21/mutt.h 2013-06-27 12:47:28.020387743 +0200
+@@ -376,6 +376,8 @@ enum
+ # endif /* USE_SSL_GNUTLS */
+ OPTSSLV3,
+ OPTTLSV1,
++ OPTTLSV1_1,
++ OPTTLSV1_2,
+ OPTSSLFORCETLS,
+ OPTSSLVERIFYDATES,
+ OPTSSLVERIFYHOST,
+diff -up mutt-1.5.21/mutt_ssl.c.tlsv1v2 mutt-1.5.21/mutt_ssl.c
+--- mutt-1.5.21/mutt_ssl.c.tlsv1v2 2010-08-25 18:31:40.000000000 +0200
++++ mutt-1.5.21/mutt_ssl.c 2013-06-27 12:47:28.021387743 +0200
+@@ -106,6 +106,18 @@ int mutt_ssl_starttls (CONNECTION* conn)
+ dprint (1, (debugfile, "mutt_ssl_starttls: Error allocating SSL_CTX\n"));
+ goto bail_ssldata;
+ }
++#ifdef SSL_OP_NO_TLSv1_1
++ if (!option(OPTTLSV1_1))
++ {
++ SSL_CTX_set_options(ssldata->ctx, SSL_OP_NO_TLSv1_1);
++ }
++#endif
++#ifdef SSL_OP_NO_TLSv1_2
++ if (!option(OPTTLSV1_2))
++ {
++ SSL_CTX_set_options(ssldata->ctx, SSL_OP_NO_TLSv1_2);
++ }
++#endif
+
+ ssl_get_client_cert(ssldata, conn);
+
+@@ -303,6 +315,21 @@ static int ssl_socket_open (CONNECTION *
+ {
+ SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1);
+ }
++ /* TLSv1.1/1.2 support was added in OpenSSL 1.0.1, but some OS distros such
++ * as Fedora 17 are on OpenSSL 1.0.0.
++ */
++#ifdef SSL_OP_NO_TLSv1_1
++ if (!option(OPTTLSV1_1))
++ {
++ SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1_1);
++ }
++#endif
++#ifdef SSL_OP_NO_TLSv1_2
++ if (!option(OPTTLSV1_2))
++ {
++ SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1_2);
++ }
++#endif
+ if (!option(OPTSSLV2))
+ {
+ SSL_CTX_set_options(data->ctx, SSL_OP_NO_SSLv2);
+diff -up mutt-1.5.21/mutt_ssl_gnutls.c.tlsv1v2 mutt-1.5.21/mutt_ssl_gnutls.c
+--- mutt-1.5.21/mutt_ssl_gnutls.c.tlsv1v2 2013-06-27 12:46:14.123389035 +0200
++++ mutt-1.5.21/mutt_ssl_gnutls.c 2013-06-27 12:47:28.018387743 +0200
+@@ -238,7 +238,11 @@ err_crt:
+ gnutls_x509_crt_deinit (clientcrt);
+ }
+
+-static int protocol_priority[] = {GNUTLS_TLS1, GNUTLS_SSL3, 0};
++/* This array needs to be large enough to hold all the possible values support
++ * by Mutt. The initialized values are just placeholders--the array gets
++ * overwrriten in tls_negotiate() depending on the $ssl_use_* options.
++ */
++static int protocol_priority[] = {GNUTLS_TLS1_2, GNUTLS_TLS1_1, GNUTLS_TLS1, GNUTLS_SSL3, 0};
+
+ /* tls_negotiate: After TLS state has been initialised, attempt to negotiate
+ * TLS over the wire, including certificate checks. */
+@@ -246,6 +250,7 @@ static int tls_negotiate (CONNECTION * c
+ {
+ tlssockdata *data;
+ int err;
++ size_t nproto = 0; /* number of tls/ssl protocols */
+
+ data = (tlssockdata *) safe_calloc (1, sizeof (tlssockdata));
+ conn->sockdata = data;
+@@ -286,22 +291,22 @@ static int tls_negotiate (CONNECTION * c
+ /* set socket */
+ gnutls_transport_set_ptr (data->state, (gnutls_transport_ptr)conn->fd);
+
++ if (option(OPTTLSV1_2))
++ protocol_priority[nproto++] = GNUTLS_TLS1_2;
++ if (option(OPTTLSV1_1))
++ protocol_priority[nproto++] = GNUTLS_TLS1_1;
++ if (option(OPTTLSV1))
++ protocol_priority[nproto++] = GNUTLS_TLS1;
++ if (option(OPTSSLV3))
++ protocol_priority[nproto++] = GNUTLS_SSL3;
++ protocol_priority[nproto] = 0;
++
+ /* disable TLS/SSL protocols as needed */
+- if (!option(OPTTLSV1) && !option(OPTSSLV3))
++ if (nproto == 0)
+ {
+ mutt_error (_("All available protocols for TLS/SSL connection disabled"));
+ goto fail;
+ }
+- else if (!option(OPTTLSV1))
+- {
+- protocol_priority[0] = GNUTLS_SSL3;
+- protocol_priority[1] = 0;
+- }
+- else if (!option(OPTSSLV3))
+- {
+- protocol_priority[0] = GNUTLS_TLS1;
+- protocol_priority[1] = 0;
+- }
+ /*
+ else
+ use the list set above
diff --git a/SOURCES/mutt-1.5.21-tmpdir.patch b/SOURCES/mutt-1.5.21-tmpdir.patch
new file mode 100644
index 0000000..9256735
--- /dev/null
+++ b/SOURCES/mutt-1.5.21-tmpdir.patch
@@ -0,0 +1,146 @@
+Subject: Changed tmpdir default to /var/tmp
+
+By default, mutt stores drafts in
+/tmp/mutt-$HOSTNAME-$UID-$PID-$REV. /tmp is designed to hold data
+that isn't guaranteed to be preserved between different invocations
+of programmes. For practical purposes, and on Debian at least, this
+translates to files being deleted on every boot, unless TMPTIME is
+amended in /etc/default/rcS and /tmp is not a tmpfs.
+
+This behaviour can cause loss of data, e.g. when the laptop dies or
+turns itself off due to low power; the user might not have a chance
+to commit the temporary mail draft s/he was working on to
+non-volatile storage.
+
+I suggest that mutt should use /var/tmp by default for its mail
+drafts, as that directory is also temporary in nature, but cleaned
+less frequently than /tmp. More specifically, the FHS dictates that
+"files and directories located in /var/tmp must not be deleted when
+the system is booted."
+
+This patch modifies all occurrences of $tmpdir, $TMPDIR and Tempdir, but
+not the documentation, which looks like it's generated from init.h.
+
+Patch created by: martin f. krafft
+ Attachments appear as follows by default: +
+-- 1 [text/plain, 7bit, 1K] /tmp/mutt-euler-8082-0 <no description> ++- 1 [text/plain, 7bit, 1K] /var/tmp/mutt-euler-8082-0 <no description> + 2 [applica/x-gunzip, base64, 422K] ~/src/mutt-0.85.tar.gz <no description> +
+ The “-” denotes that Mutt will delete the file after +@@ -6944,7 +6944,7 @@ Default: (empty)
+ This variable allows you to specify where Mutt will place its
+ temporary files needed for displaying and composing messages. If
+ this variable is not set, the environment variable $TMPDIR
is
+-used. If $TMPDIR
is not set then “/tmp
” is used.
++used. If $TMPDIR
is not set then “/var/tmp
” is used.
+
Type: string
+ Default: “ +TCFL
”
+ Controls the character used to indicate mail addressed to you. The
+diff -up mutt-1.5.21/doc/manual.txt.tmpdir mutt-1.5.21/doc/manual.txt
+--- mutt-1.5.21/doc/manual.txt.tmpdir 2012-09-27 15:04:20.601518838 +0200
++++ mutt-1.5.21/doc/manual.txt 2012-09-27 15:04:50.154724683 +0200
+@@ -4524,7 +4524,7 @@ description.
+
+ Attachments appear as follows by default:
+
+-- 1 [text/plain, 7bit, 1K] /tmp/mutt-euler-8082-0
+ This variable allows you to specify where Mutt will place its
+ temporary files needed for displaying and composing messages. If
+ this variable is not set, the environment variable $TMPDIR
is
+-used. If $TMPDIR
is not set then “/tmp
” is used.
++used. If $TMPDIR
is not set then “/var/tmp
” is used.
+
Type: string
+ Default: “ +TCFL
”
+ Controls the character used to indicate mail addressed to you. The
+diff -up mutt-1.5.21/init.c.tmpdir mutt-1.5.21/init.c
+--- mutt-1.5.21/init.c.tmpdir 2012-09-27 14:59:10.099395476 +0200
++++ mutt-1.5.21/init.c 2012-09-27 14:59:23.292484023 +0200
+@@ -2992,7 +2992,7 @@ void mutt_init (int skip_sys_rc, LIST *c
+ MailcapPath = safe_strdup ("~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");
+ }
+
+- Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/tmp");
++ Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/var/tmp");
+
+ p = getenv ("VISUAL");
+ if (!p)
+diff -up mutt-1.5.21/init.h.tmpdir mutt-1.5.21/init.h
+--- mutt-1.5.21/init.h.tmpdir 2012-09-27 14:59:46.214638908 +0200
++++ mutt-1.5.21/init.h 2012-09-27 15:00:21.541877784 +0200
+@@ -3178,7 +3178,7 @@ struct option_t MuttVars[] = {
+ ** This variable allows you to specify where Mutt will place its
+ ** temporary files needed for displaying and composing messages. If
+ ** this variable is not set, the environment variable \fC$$$TMPDIR\fP is
+- ** used. If \fC$$$TMPDIR\fP is not set then ``\fC/tmp\fP'' is used.
++ ** used. If \fC$$$TMPDIR\fP is not set then ``\fC/var/tmp\fP'' is used.
+ */
+ { "to_chars", DT_STR, R_BOTH, UL &Tochars, UL " +TCFL" },
+ /*
+diff -up mutt-1.5.21/install-sh.tmpdir mutt-1.5.21/install-sh
+--- mutt-1.5.21/install-sh.tmpdir 2012-09-27 15:00:32.246950740 +0200
++++ mutt-1.5.21/install-sh 2012-09-27 15:01:15.957247967 +0200
+@@ -332,7 +332,7 @@ do
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
++ tmpdir=${TMPDIR-/var/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+diff -up mutt-1.5.21/muttbug.sh.in.tmpdir mutt-1.5.21/muttbug.sh.in
+--- mutt-1.5.21/muttbug.sh.in.tmpdir 2012-09-27 15:01:37.097392500 +0200
++++ mutt-1.5.21/muttbug.sh.in 2012-09-27 15:01:52.061494226 +0200
+@@ -85,7 +85,7 @@ esac
+ exec > /dev/tty
+ exec < /dev/tty
+
+-SCRATCH=${TMPDIR-/tmp}/`basename $0`.`hostname`.$$
++SCRATCH=${TMPDIR-/var/tmp}/`basename $0`.`hostname`.$$
+
+ mkdir ${SCRATCH} || \
+ {
diff --git a/SOURCES/mutt-1.5.21-updating.patch b/SOURCES/mutt-1.5.21-updating.patch
new file mode 100644
index 0000000..2d2b161
--- /dev/null
+++ b/SOURCES/mutt-1.5.21-updating.patch
@@ -0,0 +1,24 @@
+# HG changeset patch
+# User Brendan Cully