View | Details | Raw Unified | Return to bug 181431
Collapse All | Expand All

(-)./Makefile (-4 / +10 lines)
Lines 9-15 Link Here
9
9
10
PORTNAME=	mutt
10
PORTNAME=	mutt
11
PORTVERSION=	1.5.21
11
PORTVERSION=	1.5.21
12
PORTREVISION=	3
12
PORTREVISION=	4
13
CATEGORIES+=	mail ipv6
13
CATEGORIES+=	mail ipv6
14
MASTER_SITES=	ftp://ftp.mutt.org/mutt/devel/ \
14
MASTER_SITES=	ftp://ftp.mutt.org/mutt/devel/ \
15
		ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/devel/ \
15
		ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/devel/ \
Lines 66-73 Link Here
66
		MAILDIR_HEADER_CACHE MAILDIR_MTIME_PATCH \
66
		MAILDIR_HEADER_CACHE MAILDIR_MTIME_PATCH \
67
		NNTP PARENT_CHILD_MATCH_PATCH \
67
		NNTP PARENT_CHILD_MATCH_PATCH \
68
		QUOTE_PATCH REVERSE_REPLY_PATCH SGMLFORMAT SIDEBAR_PATCH \
68
		QUOTE_PATCH REVERSE_REPLY_PATCH SGMLFORMAT SIDEBAR_PATCH \
69
		SIGNATURE_MENU SMIME_OUTLOOK_COMPAT SMTP TOKYOCABINET \
69
		SIGNATURE_MENU SMART_DATE SMIME_OUTLOOK_COMPAT SMTP \
70
		TRASH_PATCH XML
70
		TOKYOCABINET TRASH_PATCH XML
71
71
72
OPTIONS_SINGLE=	SCREEN
72
OPTIONS_SINGLE=	SCREEN
73
OPTIONS_RADIO=	SPELL
73
OPTIONS_RADIO=	SPELL
Lines 97-102 Link Here
97
SIDEBAR_PATCH_DESC=	Sidebar support
97
SIDEBAR_PATCH_DESC=	Sidebar support
98
SIGNATURE_MENU_DESC=	Signature menu
98
SIGNATURE_MENU_DESC=	Signature menu
99
SLANG_DESC=	SLANG support
99
SLANG_DESC=	SLANG support
100
SMART_DATE_DESC=	Dynamic date formatting with "%@"
100
SMIME_OUTLOOK_COMPAT_DESC=	SMIME outlook compatibility
101
SMIME_OUTLOOK_COMPAT_DESC=	SMIME outlook compatibility
101
SMTP_DESC=	SMTP relay support
102
SMTP_DESC=	SMTP relay support
102
TOKYOCABINET_DESC=	Use tokyocabinet instead of Berkley DB
103
TOKYOCABINET_DESC=	Use tokyocabinet instead of Berkley DB
Lines 194-199 Link Here
194
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook
195
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smime-outlook
195
.endif
196
.endif
196
197
198
.if ${PORT_OPTIONS:MSMART_DATE}
199
post-patch::
200
	@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-smartdate
201
.endif
202
197
.if ${PORT_OPTIONS:MSIGNATURE_MENU}
203
.if ${PORT_OPTIONS:MSIGNATURE_MENU}
198
IGNORE=	the WITH_SIGNATURE_MENU does not work at the moment
204
IGNORE=	the WITH_SIGNATURE_MENU does not work at the moment
199
XML_NEEDED=	yes
205
XML_NEEDED=	yes
Lines 390-396 Link Here
390
SCRIPTS_ENV+=	QUOTE_PATCH="yes"
396
SCRIPTS_ENV+=	QUOTE_PATCH="yes"
391
.endif
397
.endif
392
398
393
.if ${PORT_OPTIONS:MIMAP_HEADER_CACHE}
399
.if ${PORT_OPTIONS:MIMAP_HEADER_CACHE} || ${PORT_OPTIONS:MMAILDIR_HEADER_CACHE}
394
.if ${PORT_OPTIONS:MTOKYOCABINET}
400
.if ${PORT_OPTIONS:MTOKYOCABINET}
395
CONFIGURE_ARGS+=	--enable-hcache --without-gdbm --without-bdb --with-tokyocabinet
401
CONFIGURE_ARGS+=	--enable-hcache --without-gdbm --without-bdb --with-tokyocabinet
396
LIB_DEPENDS+=		tokyocabinet.9:${PORTSDIR}/databases/tokyocabinet
402
LIB_DEPENDS+=		tokyocabinet.9:${PORTSDIR}/databases/tokyocabinet
(-)./files/extra-patch-smartdate (+126 lines)
Line 0 Link Here
1
--- mutt.h
2
+++ mutt.h
3
@@ -133,6 +133,16 @@
4
   M_FORMAT_NOFILTER	= (1<<7)  /* do not allow filtering on this pass */
5
 } format_flag;
6
 
7
+/* flags for SmartDate */
8
+typedef enum {
9
+    FUTURE      = 1,
10
+    SMARTTIME   = 2,
11
+    YESTERDAY   = 3,
12
+    WEEKDAY     = 4,
13
+    STANDARD    = 5,
14
+    ANCIENT     = 6
15
+} smartdate_type;
16
+
17
 /* types for mutt_add_hook() */
18
 #define M_FOLDERHOOK	1
19
 #define M_MBOXHOOK	(1<<1)
20
--- hdrline.c
21
+++ hdrline.c
22
@@ -231,6 +231,89 @@
23
  * %Y = `x-label:' field (if present, tree unfolded, and != parent's x-label)
24
  * %Z = status flags	*/
25
 
26
+static void
27
+format_smartdate( char *buf, size_t max, struct tm *tm, smartdate_type type )
28
+{
29
+    char *strftime_fmt = NULL;
30
+
31
+    switch( type ) {
32
+        case FUTURE:        /* Date in the future */
33
+            strftime_fmt = "%d%h%y!";
34
+            break;
35
+        case SMARTTIME:     /* Today */
36
+            strftime_fmt = "%I:%M %p";
37
+            break;
38
+        case YESTERDAY:     /* Yesterday */
39
+            strncpy( buf, "Yesterday", max );
40
+            break;
41
+        case WEEKDAY:       /* Within the last 7 days */
42
+            strftime_fmt = "%A";
43
+            break;
44
+        case STANDARD:      /* Within the last six months */
45
+            strftime_fmt = "%h %d";
46
+            break;
47
+        case ANCIENT:       /* Older than 6 months */
48
+            strftime_fmt = "%h %Y";
49
+            break;
50
+    }
51
+
52
+    if( strftime_fmt != NULL ) {
53
+        strftime( buf, max, strftime_fmt, tm );
54
+    }
55
+}
56
+
57
+static void
58
+smartdate( char *buf, size_t max, struct tm *tm )
59
+{
60
+    smartdate_type type = 0;
61
+
62
+    struct tm now;
63
+
64
+    time_t sse = mktime( tm );   /* Seconds since epoch */
65
+    time_t sse_now = time(NULL); /* Seconds since epoch until now */
66
+
67
+    int dse = 0;            /* Days since epoch */
68
+    int dse_now = 0;        /* Days since epoch until today */
69
+
70
+    /* Calculate the number of days since epoch */
71
+    dse = sse / (60*60*24);
72
+    dse_now = sse_now / (60*60*24);
73
+
74
+    /* Default display type */
75
+    type = STANDARD;
76
+
77
+    /* Check if the date is in the future */
78
+    if( dse > dse_now ) {
79
+        type = FUTURE;
80
+    }
81
+    else {
82
+        int diff = dse_now - dse;
83
+        if( diff == 0 ) type = SMARTTIME;
84
+        else if( diff == 1 ) type = YESTERDAY;
85
+        else if( diff < 7 ) type = WEEKDAY;
86
+        else if( diff > 215 ) type = ANCIENT;  /* Surely older than six
87
+                                                  months */
88
+        else if( diff > 180 ) {
89
+            /*
90
+             * Slightly heavy calculation to check if the date is more
91
+             * than six months in the past.  This calculation uses
92
+             * calendar months and not the exact number of days.  So,
93
+             * January 31, 2003 would be considered more than six months
94
+             * old whether today's date is August 1 or August 31, 2003
95
+             */
96
+            int monthdiff;
97
+            localtime_r( &sse_now, &now );
98
+            monthdiff = ( now.tm_mon - tm->tm_mon )
99
+                + ( ( now.tm_year - tm->tm_year ) * 12 );
100
+            if( monthdiff > 6 ) {
101
+                type = ANCIENT;
102
+            }
103
+        }
104
+    }
105
+
106
+    format_smartdate( buf, max, tm, type );
107
+}
108
+
109
 static const char *
110
 hdr_format_str (char *dest,
111
 		size_t destlen,
112
@@ -462,7 +545,13 @@
113
 	  tm = gmtime (&T);
114
 	}
115
 
116
-	strftime (buf2, sizeof (buf2), dest, tm);
117
+	/* Identify the non-strftime smartdate pattern (%@) */
118
+	if( strncmp( dest, "%@", 2 ) == 0 ) {
119
+		smartdate( buf2, sizeof( buf2 ), tm );
120
+	}
121
+	else {
122
+		strftime (buf2, sizeof (buf2), dest, tm);
123
+	}
124
 
125
 	if (do_locales)
126
 	  setlocale (LC_TIME, "C");
(-)./files/patch-tls-version (+112 lines)
Line 0 Link Here
1
--- init.h.orig	2010-09-15 08:39:31.000000000 -0700
2
+++ init.h	2012-03-28 10:58:42.870572835 -0700
3
@@ -2972,6 +2972,18 @@ struct option_t MuttVars[] = {
4
   ** SSL authentication process.
5
   */
6
 #ifdef USE_SSL_OPENSSL
7
+  { "ssl_use_tlsv1_1", DT_BOOL, R_NONE, OPTTLSV1_1, 1 },
8
+  /*
9
+  ** .pp
10
+  ** This variable specifies whether to attempt to use TLSv1.1 in the
11
+  ** SSL authentication process.
12
+  */
13
+  { "ssl_use_tlsv1_2", DT_BOOL, R_NONE, OPTTLSV1_2, 1 },
14
+  /*
15
+  ** .pp
16
+  ** This variable specifies whether to attempt to use TLSv1.2 in the
17
+  ** SSL authentication process.
18
+  */
19
   { "ssl_usesystemcerts", DT_BOOL, R_NONE, OPTSSLSYSTEMCERTS, 1 },
20
   /*
21
   ** .pp
22
--- mutt.h	2010-09-13 10:19:55.000000000 -0700
23
+++ mutt.h	2012-03-28 10:59:24.437237530 -0700
24
@@ -376,6 +376,8 @@ enum
25
 # endif /* USE_SSL_GNUTLS */
26
   OPTSSLV3,
27
   OPTTLSV1,
28
+  OPTTLSV1_1,
29
+  OPTTLSV1_2,
30
   OPTSSLFORCETLS,
31
   OPTSSLVERIFYDATES,
32
   OPTSSLVERIFYHOST,
33
--- mutt_ssl.c.orig	2010-08-25 18:31:40.000000000 +0200
34
+++ mutt_ssl.c	2013-08-20 13:51:14.000000000 +0200
35
@@ -100,12 +100,33 @@
36
     goto bail;
37
 
38
   ssldata = (sslsockdata*) safe_calloc (1, sizeof (sslsockdata));
39
-  /* the ssl_use_xxx protocol options don't apply. We must use TLS in TLS. */
40
-  if (! (ssldata->ctx = SSL_CTX_new (TLSv1_client_method ())))
41
+  /* the ssl_use_xxx protocol options don't apply. We must use TLS in TLS.
42
+   * TLSv1.2 support was added in OpenSSL 1.0.1.  RHEL6 shipped with 1.0.0 so
43
+   * our configure script checks for TLSv1.2 availability.
44
+   */
45
+  if (! (ssldata->ctx = SSL_CTX_new (
46
+#ifdef HAVE_TLSV1_2_CLIENT_METHOD
47
+				  TLSv1_2_client_method ()
48
+#else
49
+				  TLSv1_client_method ()
50
+#endif
51
+				  )))
52
   {
53
     dprint (1, (debugfile, "mutt_ssl_starttls: Error allocating SSL_CTX\n"));
54
     goto bail_ssldata;
55
   }
56
+#ifdef SSL_OP_NO_TLSv1_1
57
+  if (!option(OPTTLSV1_1))
58
+  {
59
+    SSL_CTX_set_options(ssldata->ctx, SSL_OP_NO_TLSv1_1);
60
+  }
61
+#endif
62
+#ifdef SSL_OP_NO_TLSv1_2
63
+  if (!option(OPTTLSV1_2))
64
+  {
65
+    SSL_CTX_set_options(ssldata->ctx, SSL_OP_NO_TLSv1_2);
66
+  }
67
+#endif
68
 
69
   ssl_get_client_cert(ssldata, conn);
70
 
71
@@ -303,6 +324,21 @@
72
   {
73
     SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1);
74
   }
75
+  /* TLSv1.1/1.2 support was added in OpenSSL 1.0.1, but some OS distros such
76
+   * as Fedora 17 are on OpenSSL 1.0.0.
77
+   */
78
+#ifdef SSL_OP_NO_TLSv1_1
79
+  if (!option(OPTTLSV1_1))
80
+  {
81
+    SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1_1);
82
+  }
83
+#endif
84
+#ifdef SSL_OP_NO_TLSv1_2
85
+  if (!option(OPTTLSV1_2))
86
+  {
87
+    SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1_2);
88
+  }
89
+#endif
90
   if (!option(OPTSSLV2))
91
   {
92
     SSL_CTX_set_options(data->ctx, SSL_OP_NO_SSLv2);
93
@@ -375,8 +411,8 @@
94
   if (!ssl_check_certificate (conn, ssldata))
95
     return -1;
96
 
97
-  mutt_message (_("SSL connection using %s (%s)"),
98
-    SSL_get_cipher_version (ssldata->ssl), SSL_get_cipher_name (ssldata->ssl));
99
+  mutt_message (_("%s connection using %s (%s)"),
100
+    SSL_get_version(ssldata->ssl), SSL_get_cipher_version (ssldata->ssl), SSL_get_cipher_name (ssldata->ssl));
101
   mutt_sleep (0);
102
 
103
   return 0;
104
@@ -911,7 +947,7 @@
105
 
106
 static int interactive_check_cert (X509 *cert, int idx, int len)
107
 {
108
-  char *part[] =
109
+  static const char * const part[] =
110
     {"/CN=", "/Email=", "/O=", "/OU=", "/L=", "/ST=", "/C="};
111
   char helpstr[LONG_STRING];
112
   char buf[STRING];
(-)./pkg-descr (-1 / +1 lines)
Lines 6-11 Link Here
6
RFC1522 support for encoded headers), customizable key bindings, POP3,
6
RFC1522 support for encoded headers), customizable key bindings, POP3,
7
Delivery Status Notification (DSN) support, and PGP/MIME.
7
Delivery Status Notification (DSN) support, and PGP/MIME.
8
8
9
Mutt User Information:	http://www.math.fu-berlin.de/~guckes/mutt/
9
Mutt FAQ:	http://dev.mutt.org/trac/wiki/MuttFaq
10
10
11
WWW: http://www.mutt.org/
11
WWW: http://www.mutt.org/

Return to bug 181431