diff options
Diffstat (limited to 'mail/fetchmail/files')
-rw-r--r-- | mail/fetchmail/files/patch-SNI-Gitlab-9b8b634 | 39 | ||||
-rw-r--r-- | mail/fetchmail/files/patch-ZZZ-87626c2707cc0d82e49e160ab3c85430ff33534f | 159 | ||||
-rw-r--r-- | mail/fetchmail/files/patch-configure | 27 | ||||
-rw-r--r-- | mail/fetchmail/files/patch-fetchmail.c | 26 | ||||
-rw-r--r-- | mail/fetchmail/files/patch-socket.c | 20 |
5 files changed, 161 insertions, 110 deletions
diff --git a/mail/fetchmail/files/patch-SNI-Gitlab-9b8b634 b/mail/fetchmail/files/patch-SNI-Gitlab-9b8b634 deleted file mode 100644 index db96b4208bf8..000000000000 --- a/mail/fetchmail/files/patch-SNI-Gitlab-9b8b634 +++ /dev/null @@ -1,39 +0,0 @@ -Line numbers and --- line adapted. - -From 9b8b634312f169fab872f3580c2febe5af031615 Mon Sep 17 00:00:00 2001 -From: Matthias Andree <matthias.andree@gmx.de> -Date: Sat, 11 Feb 2017 19:39:56 +0100 -Subject: [PATCH] TLS: set hostname for SNI. - ---- - socket.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/socket.c b/socket.c -index aec319e3..17d60cbd 100644 ---- ./socket.c -+++ b/socket.c -@@ -1029,6 +1029,20 @@ int SSLOpen(int sock, char *mycert, char *mykey, const char *myproto, int certck - _verify_ok = 1; - _prev_err = -1; - -+ /* -+ * Support SNI, some servers (googlemail) appear to require it. -+ */ -+ { -+ long r; -+ r = SSL_set_tlsext_host_name(_ssl_context[sock], servercname); -+ -+ if (0 == r) { -+ /* handle error */ -+ report(stderr, GT_("Warning: SSL_set_tlsext_host_name(%p, \"%s\") failed (code %#lx), trying to continue.\n"), _ssl_context[sock], servercname, r); -+ ERR_print_errors_fp(stderr); -+ } -+ } -+ - if( mycert || mykey ) { - - /* Ok... He has a certificate file defined, so lets declare it. If --- -2.18.1 - diff --git a/mail/fetchmail/files/patch-ZZZ-87626c2707cc0d82e49e160ab3c85430ff33534f b/mail/fetchmail/files/patch-ZZZ-87626c2707cc0d82e49e160ab3c85430ff33534f new file mode 100644 index 000000000000..e6d1a227e22a --- /dev/null +++ b/mail/fetchmail/files/patch-ZZZ-87626c2707cc0d82e49e160ab3c85430ff33534f @@ -0,0 +1,159 @@ +From 87626c2707cc0d82e49e160ab3c85430ff33534f Mon Sep 17 00:00:00 2001 +From: Matthias Andree <matthias.andree@gmx.de> +Date: Sat, 24 Aug 2019 17:53:08 +0200 +Subject: [PATCH] Properly report size of mailboxes of 2 GibiB or above. + +To fix Debian Bug#873668, reported by Andreas Schmidt. +This requires C99's new long long type. +--- + NEWS | 7 +++++++ + driver.c | 7 ++++--- + etrn.c | 2 +- + fetchmail.h | 2 +- + imap.c | 2 +- + odmr.c | 2 +- + pop2.c | 2 +- + pop3.c | 4 ++-- + 8 files changed, 18 insertions(+), 10 deletions(-) + +diff --git a/NEWS b/NEWS +index c01f9df9..9485edca 100644 +--- a/NEWS ++++ b/NEWS +@@ -63,5 +63,12 @@ + + -------------------------------------------------------------------------------- + ++## BUG FIXES ++* fetchmail can now report mailbox sizes of 2^31 octets and beyond. ++ This requires C99 support (for the long long type). ++ Fixes Debian Bug#873668, reported by Andreas Schmidt. ++ ++-------------------------------------------------------------------------------- ++ + fetchmail-6.4.1 (released 2019-09-28, 27473 LoC): + +diff --git a/driver.c b/driver.c +index d21a32ab..a5033729 100644 +--- a/driver.c ++++ b/driver.c +@@ -932,7 +932,7 @@ static int do_session( + { + /* sigsetjmp returned zero -> normal operation */ + char buf[MSGBUFSIZE+1], *realhost; +- int count, newm, bytes; ++ int count, newm; + int fetches, dispatches, transient_errors, oldphase; + struct idlist *idp; + +@@ -1306,6 +1306,7 @@ is restored.")); + + /* compute # of messages and number of new messages waiting */ + stage = STAGE_GETRANGE; ++ unsigned long long bytes; + err = (ctl->server.base_protocol->getrange)(mailserver_socket, ctl, idp->id, &count, &newm, &bytes); + if (err != 0) + goto cleanUp; +@@ -1335,10 +1336,10 @@ is restored.")); + "%d messages for %s", + count), + count, buf); +- if (bytes == -1) ++ if (bytes == (unsigned long long)-1) // mailbox size unsupported + report_complete(stdout, ".\n"); + else +- report_complete(stdout, GT_(" (%d octets).\n"), bytes); ++ report_complete(stdout, GT_(" (%llu octets).\n"), bytes); + } + else + { +diff --git a/etrn.c b/etrn.c +index f3fab0ce..12b9d3fd 100644 +--- a/etrn.c ++++ b/etrn.c +@@ -31,7 +31,7 @@ static int etrn_ok (int sock, char *argbuf) + } + + static int etrn_getrange(int sock, struct query *ctl, const char *id, +- int *countp, int *newp, int *bytes) ++ int *countp, int *newp, unsigned long long *bytes) + /* send ETRN and interpret the response */ + { + int ok, opts; +diff --git a/fetchmail.h b/fetchmail.h +index 23ba6e6e..72259e10 100644 +--- a/fetchmail.h ++++ b/fetchmail.h +@@ -210,7 +210,7 @@ struct method /* describe methods for protocol state machine */ + /* response_parsing function */ + int (*getauth)(int, struct query *, char *); + /* authorization fetcher */ +- int (*getrange)(int, struct query *, const char *, int *, int *, int *); ++ int (*getrange)(int, struct query *, const char *, int *, int *, unsigned long long *); + /* get message range to fetch */ + int (*getsizes)(int, int, int *); + /* get sizes of messages */ +diff --git a/imap.c b/imap.c +index 7b80679a..7836acd7 100644 +--- a/imap.c ++++ b/imap.c +@@ -883,7 +883,7 @@ static int imap_search(int sock, struct query *ctl, int count) + static int imap_getrange(int sock, + struct query *ctl, + const char *folder, +- int *countp, int *newp, int *bytes) ++ int *countp, int *newp, unsigned long long *bytes) + /* get range of messages to be fetched */ + { + int ok; +diff --git a/odmr.c b/odmr.c +index 85decb6d..d1c011c4 100644 +--- a/odmr.c ++++ b/odmr.c +@@ -36,7 +36,7 @@ static int odmr_ok (int sock, char *argbuf) + } + + static int odmr_getrange(int sock, struct query *ctl, const char *id, +- int *countp, int *newp, int *bytes) ++ int *countp, int *newp, unsigned long long *bytes) + /* send ODMR and then run a reverse SMTP session */ + { + int ok, opts, smtp_sock; +diff --git a/pop2.c b/pop2.c +index 7c843616..5a5a1bd1 100644 +--- a/pop2.c ++++ b/pop2.c +@@ -80,7 +80,7 @@ static int pop2_getauth(int sock, struct query *ctl, char *buf) + } + + static int pop2_getrange(int sock, struct query *ctl, const char *folder, +- int *countp, int *newp, int *bytes) ++ int *countp, int *newp, unsigned long long *bytes) + /* get range of messages to be fetched */ + { + (void)ctl; +diff --git a/pop3.c b/pop3.c +index 6efe1b7e..25efbaad 100644 +--- a/pop3.c ++++ b/pop3.c +@@ -969,7 +969,7 @@ static int pop3_slowuidl( int sock, struct query *ctl, int *countp, int *newp) + static int pop3_getrange(int sock, + struct query *ctl, + const char *folder, +- int *countp, int *newp, int *bytes) ++ int *countp, int *newp, unsigned long long *bytes) + /* get range of messages to be fetched */ + { + int ok; +@@ -992,7 +992,7 @@ static int pop3_getrange(int sock, + if (ok == 0) { + int asgn; + +- asgn = sscanf(buf,"%d %d", countp, bytes); ++ asgn = sscanf(buf,"%d %llu", countp, bytes); + if (asgn != 2) + return PS_PROTOCOL; + } else +-- +2.22.0 + diff --git a/mail/fetchmail/files/patch-configure b/mail/fetchmail/files/patch-configure index 0ff6ec96d00a..98aa9466f314 100644 --- a/mail/fetchmail/files/patch-configure +++ b/mail/fetchmail/files/patch-configure @@ -1,5 +1,5 @@ ---- configure.orig 2013-04-23 21:36:55 UTC -+++ configure +--- a/configure.orig 2013-04-23 21:36:55 UTC ++++ b/configure @@ -9552,11 +9552,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" @@ -28,26 +28,3 @@ ; return 0; } -@@ -10131,6 +10131,22 @@ fi - - cat >>confdefs.h <<_ACEOF - #define HAVE_DECL_SSLV2_CLIENT_METHOD $ac_have_decl -+_ACEOF -+ -+ ;; -+esac -+ -+case "$LIBS" in *-lssl*) -+ ac_fn_c_check_decl "$LINENO" "SSLv3_client_method" "ac_cv_have_decl_SSLv3_client_method" "#include <openssl/ssl.h> -+" -+if test "x$ac_cv_have_decl_SSLv3_client_method" = xyes; then : -+ ac_have_decl=1 -+else -+ ac_have_decl=0 -+fi -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_DECL_SSLV3_CLIENT_METHOD $ac_have_decl - _ACEOF - - ;; diff --git a/mail/fetchmail/files/patch-fetchmail.c b/mail/fetchmail/files/patch-fetchmail.c deleted file mode 100644 index 5e0b18eee2fa..000000000000 --- a/mail/fetchmail/files/patch-fetchmail.c +++ /dev/null @@ -1,26 +0,0 @@ ---- fetchmail.c.orig 2018-12-30 11:43:19.032822000 -0600 -+++ fetchmail.c 2018-12-30 12:51:55.552234000 -0600 -@@ -50,6 +50,10 @@ - #include <arpa/nameser.h> - #include <resolv.h> - -+#ifdef SSL_ENABLE -+#include <openssl/ssl.h> -+#endif -+ - #ifndef ENETUNREACH - #define ENETUNREACH 128 /* Interactive doesn't know this */ - #endif /* ENETUNREACH */ -@@ -263,10 +267,10 @@ - #ifdef SSL_ENABLE - "+SSL" - #endif --#if HAVE_DECL_SSLV2_CLIENT_METHOD + 0 == 0 -+#if (HAVE_DECL_SSLV2_CLIENT_METHOD + 0 == 0) && !defined(OPENSSL_NO_SSL2) - "-SSLv2" - #endif --#if HAVE_DECL_SSLV3_CLIENT_METHOD + 0 == 0 -+#if (HAVE_DECL_SSLV3_CLIENT_METHOD + 0 == 0) && !defined(OPENSSL_NO_SSL3_METHOD) - "-SSLv3" - #endif - #ifdef OPIE_ENABLE diff --git a/mail/fetchmail/files/patch-socket.c b/mail/fetchmail/files/patch-socket.c deleted file mode 100644 index bf82f7e20712..000000000000 --- a/mail/fetchmail/files/patch-socket.c +++ /dev/null @@ -1,20 +0,0 @@ ---- socket.c.orig 2018-12-30 11:43:19.042365000 -0600 -+++ socket.c 2018-12-30 12:46:39.062201000 -0600 -@@ -910,7 +910,7 @@ - _ssl_context[sock] = NULL; - if(myproto) { - if(!strcasecmp("ssl2",myproto)) { --#if HAVE_DECL_SSLV2_CLIENT_METHOD + 0 > 0 -+#if (HAVE_DECL_SSLV2_CLIENT_METHOD + 0 > 0) && !defined(OPENSSL_NO_SSL2) - _ctx[sock] = SSL_CTX_new(SSLv2_client_method()); - #else - report(stderr, GT_("Your OpenSSL version does not support SSLv2.\n")); -@@ -918,7 +918,7 @@ - #endif - avoid_ssl_versions &= ~SSL_OP_NO_SSLv2; - } else if(!strcasecmp("ssl3",myproto)) { --#if HAVE_DECL_SSLV3_CLIENT_METHOD + 0 > 0 -+#if (HAVE_DECL_SSLV3_CLIENT_METHOD + 0 > 0) && !defined(OPENSSL_NO_SSL3_METHOD) - _ctx[sock] = SSL_CTX_new(SSLv3_client_method()); - #else - report(stderr, GT_("Your OpenSSL version does not support SSLv3.\n")); |