Skip to content
Snippets Groups Projects
Commit 205eb9b9 authored by Matthias Andree's avatar Matthias Andree
Browse files

mail/fetchmail*: update to 6.5.0

Improve upon the prior opie handling and use the port on FreeBSD 14.
For the FreeBSD 13 base OpenSSL 1.x version, allow it by patching
socket.c, and also simplify the EVP_MD* API update check which will go
upstream.

PR:		282413
Approved by:	Corey Halpin <chalpin@cs.wisc.edu> (maintainer)
parent 1ac717b9
No related branches found
No related tags found
No related merge requests found
PORTNAME?= fetchmail
DISTVERSION= 6.4.39
DISTVERSION= 6.5.0
PORTREVISION?= 0
CATEGORIES= mail
# The next line is inherited by the fetchmailconf dependent port,
# do NOT replace fetchmail by ${PORTNAME}
MASTER_SITES= SF/fetchmail/branch_6.4/
MASTER_SITES= SF/fetchmail/branch_6.5/
MAINTAINER= chalpin@cs.wisc.edu
COMMENT?= Batch mail retrieval utility for IMAP/POP3/ETRN/ODMR
......@@ -27,7 +27,7 @@ GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
# the added PYTHON=: suppresses python builds,
# see ../../mail/fetchmailconf/ for the configuration tool
CONFIGURE_ARGS= --enable-fallback=no \
CONFIGURE_ARGS= --enable-opie \
--enable-RPA \
--enable-SDPS \
--without-hesiod \
......@@ -37,7 +37,6 @@ CONFIGURE_ARGS= --enable-fallback=no \
# for instance, libcom_err.so on GSSAPI_NONE builds:
LDFLAGS+= -L${LOCALBASE}/lib -Wl,--as-needed
PATCH_STRIP= -p1
SUB_FILES= pkg-message
USERS= ${PORTNAME}
GROUPS= ${USERS}
......@@ -102,8 +101,10 @@ post-install-DOCS-on:
.include <bsd.port.pre.mk>
.if (${OPSYS} == FreeBSD && ${OSVERSION} < 1400072) || ${OPSYS} != FreeBSD
CONFIGURE_ARGS+= --enable-opie
.if ${MASTERDIR} == ${.CURDIR} && ${OPSYS} == FreeBSD
. if ${OSVERSION} >= 1400072
LIB_DEPENDS+= libopie.so:security/opie # moved to port (from base in 13.X)
. endif
.endif
.include <bsd.port.post.mk>
TIMESTAMP = 1721468814
SHA256 (fetchmail-6.4.39.tar.xz) = 75109a1f307b538155fa05f5ef298e8298cb4deae95aed24c16b38d36ff0a186
SIZE (fetchmail-6.4.39.tar.xz) = 1221596
TIMESTAMP = 1730243037
SHA256 (fetchmail-6.5.0.tar.xz) = 42611aea4861a5311e5116843f01c203dceadf440bf2eb1b4a43a445f2977668
SIZE (fetchmail-6.5.0.tar.xz) = 1108148
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 -up work/fetchmail-6.4.10/NEWS.orig work/fetchmail-6.4.10/NEWS
--- a/NEWS
+++ b/NEWS
@@ -63,7 +63,13 @@ removed from a 6.5.0 or newer release.)
* Fetchmail does not guarantee compatibility with EOL OpenSSL versions. Support
for end-of-life OpenSSL versions may be removed even from patchlevel releases.
----------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+## 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.10 (released 2020-08-27, 27596 LoC):
# REGRESSION FIX:
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
FreeBSD's security team needs to maintain OpenSSL 1.1.1's
security to a sane level without upstream support... but permit the build
for FreeBSD 13.3 and 13.4:
--- socket.c.orig 2024-09-28 09:20:10 UTC
+++ socket.c
@@ -375,7 +375,7 @@ enum { SSL_min_security_level = 2 };
# ifndef TLSprovider
# define TLSprovider "OpenSSL"
# endif
-# define fm_MIN_OPENSSL_VER 0x30000090L
+# define fm_MIN_OPENSSL_VER 0x1010117fL
/* do not warn about OpenSSL 3.2.0, the 3.2.1 fix is of low priority */
# if OPENSSL_VERSION_NUMBER >= 0x30100000L && OPENSSL_VERSION_NUMBER < 0x30200000L
# if OPENSSL_VERSION_NUMBER < 0x30100040L
@@ -402,7 +402,7 @@ enum { SSL_min_security_level = 2 };
#endif /* USING_WOLFSSL */
/* workaround for EVP_MD_fetch API - missing on wolfSSL and LibreSSL */
-#if defined(USING_WOLFSSL) || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x30000000L
# define EVP_MD_fetch(x, digest, y) (EVP_get_digestbyname(digest))
# define EVP_MD_free(x) /* NOOP */
# define fm_EVP_MD_const const // compatibility const EVP_MD* from EVP_get_digestbyname()
Cherry-pick from upstream 8f00c607, see
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282413#c4
--- tls-aux.h.orig 2024-08-18 17:42:19 UTC
+++ tls-aux.h
@@ -18,12 +18,6 @@
# ifdef LIBWOLFSSL_VERSION_HEX
# define USING_WOLFSSL 1
# define OSSL110_API 1
-# ifndef OPENSSL_COMPATIBLE_DEFAULTS
-# error "wolfSSL was compiled without -DOPENSSL_COMPATIBLE_DEFAULTS. Recompile and reinstall wolfSSL!"
-# endif
-# ifndef HAVE_EX_DATA
-# error "wolfSSL was configured without --enable-context-extra-user-data. Recompile and reinstall wolfSSL!"
-# endif
# else
# if OPENSSL_VERSION_NUMBER < 0x1010000fL
# undef OSSL110_API
bin/fetchmail
share/man/man1/fetchmail.1.gz
@comment %%NLS%%share/locale/ca/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/cs/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/da/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/de/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/el/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/en_GB/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/eo/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/es/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/fi/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/fr/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/gl/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/id/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/it/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/ja/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/nl/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/pl/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/pt_BR/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/ro/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/ru/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/sk/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/sq/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/sr/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/sv/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/tr/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/vi/LC_MESSAGES/fetchmail.mo
@comment %%NLS%%share/locale/zh_CN/LC_MESSAGES/fetchmail.mo
@sample(fetchmail,fetchmail,600) etc/fetchmailrc.sample
@dir(fetchmail,fetchmail,755) /var/run/fetchmail
PORTNAME= fetchmailconf
PORTREVISION= 1
PORTREVISION= 0
DISTNAME= fetchmail-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
# NOTE: MASTER_SITES in ../fetchmail must NOT use the $PORTNAME variable,
# else _this_ port (fetchmailconf) becomes unfetchable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment