Bug 287435 - mail/fetchmail: update to 6.5.3
Summary: mail/fetchmail: update to 6.5.3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Matthias Andree
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2025-06-10 20:27 UTC by Matthias Andree
Modified: 2025-06-11 18:00 UTC (History)
1 user (show)

See Also:
chalpin: maintainer-feedback+
mandree: merge-quarterly+


Attachments
patch to update mail/fetchmail[conf] to 6.5.3 (1.90 KB, patch)
2025-06-10 20:27 UTC, Matthias Andree
no flags Details | Diff
v2 of fetchmail upgrade patch to 6.5.3, fixing fetchmail.c compilation failure with WOLFSSL option enabled (3.84 KB, patch)
2025-06-11 00:00 UTC, Matthias Andree
chalpin: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Andree freebsd_committer freebsd_triage 2025-06-10 20:27:05 UTC
Created attachment 261162 [details]
patch to update mail/fetchmail[conf] to 6.5.3
Comment 1 Corey Halpin 2025-06-10 22:20:22 UTC
Build with default options passes `poudriere testport` and works nicely in my testing.

However, when I try to build with WolfSSL, I see the following build failure:

fetchmail.c:347:20: error: use of undeclared identifier 'OPENSSL_DIR'
  347 |                         OpenSSL_version(OPENSSL_DIR),
      |                                         ^
fetchmail.c:348:20: error: use of undeclared identifier 'OPENSSL_ENGINES_DIR'
  348 |                         OpenSSL_version(OPENSSL_ENGINES_DIR));
      |                                         ^
2 errors generated.
gmake[2]: *** [Makefile:1196: fetchmail.o] Error 1
Comment 2 Matthias Andree freebsd_committer freebsd_triage 2025-06-10 22:31:34 UTC
That's fascinating™ because on my Fedora Linux 42 where I manually built WolfSSL 5.8.0-stable from Git and installed it, fetchmail 6.5.3 builds just fine...
Comment 3 Matthias Andree freebsd_committer freebsd_triage 2025-06-10 23:37:39 UTC
So, on my Linux wolfSSL build, wolfSSL comes up claiming compatibility with OPENSSL_VERSION_NUMBER 0x10001040 - that was my development platform.

On FreeBSD 14.3, wolfSSL comes up claiming compatibility with
OPENSSL_VERSION_NUMBER 0x1010000f.

Now, the OpenSSL_version() API - which is documented as having been added in OpenSSL 3.0 in the manpage, is defined as macro in wolfSSL, and depending on version, discards its argument (which hides the missing macros OPENSSL_DIR and OPENSSL_ENGINE_DIR), or not:

/usr/local/include/wolfssl/openssl/ssl.h, l. 1804ff (as of 5.8.0_1):

#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
#define OpenSSL_version(x)              wolfSSL_OpenSSL_version(x)
#else
#define OpenSSL_version(x)              wolfSSL_OpenSSL_version()
#endif

The upper part happens on FreeBSD and fails,
the lower part happens on my Linux, discarding the undefined macro names and masking the design flaw: wolfSSL doesn't expose OPENSSL_DIR or OPENSSL_ENGINES_DIR, and isn't supposed to.  Running wolfSSL_OpenSSL_version() without argument doesn't make sense because then it'll always return the same information and we've already printed what we're getting before, so we can as well forgo that.

Revised patch coming up, which will mask lines 346...348 unless the two failing OPENSSL*DIR macros are defined and OPENSSL_VERSION_NUMBER is for a 3.x.y release.
Comment 4 Matthias Andree freebsd_committer freebsd_triage 2025-06-11 00:00:38 UTC
Created attachment 261165 [details]
v2 of fetchmail upgrade patch to 6.5.3, fixing fetchmail.c compilation failure with WOLFSSL option enabled

This adds the patch I am also using upstream, without the NEWS part, from 
https://gitlab.com/fetchmail/fetchmail/-/commit/c598c50ffda0dcac38b8bd01350dc6894a8efce4

to fix the compiler trouble on fetchmail.c when the WOLFSSL option is enabled.
Comment 5 Corey Halpin 2025-06-11 12:05:52 UTC
Looks good to me. Built package works in my testing.

mail/fetchmail passes 'poudriere testport' on both amd64 and i386 under 14.2 and 13.4 for the following configurations:
 - Default settings 
 - ssl=base, GSSAPI_MIT
 - ssl=base, GSSAPI_NONE
 - ssl=openssl, GSSAPI_MIT
 - ssl=openssl, GSSAPI_NONE
 - WolfSSL
 - no NLS
 - no DOCS
Comment 6 commit-hook freebsd_committer freebsd_triage 2025-06-11 17:57:42 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fd5d3db1d45fee8a8683ff5bedf12e461d0cb16a

commit fd5d3db1d45fee8a8683ff5bedf12e461d0cb16a
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2025-06-10 20:21:13 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2025-06-11 17:56:54 +0000

    mail/fetchmail: update to 6.5.3

    = BUGFIXES:
    * IMAP: Reinstate workaround for missing IDLE support if --idle is requested.
      This had been a long-standing feature but got broken in fetchmail 6.4.22
      (commit 616e8c70).  Thanks to Lukáš Tesař for the detailed report including
      a Git bisect that identified this faulty commit.  Fixes Gitlab issue #69.
    * IMAP: Only print 'will idle after poll' if --idle is enabled
      and either offered by the server, or forced through --forceidle.
      This fixes a regression introduced in fetchmail 6.4.22 (commit 616e8c70).

    = TRANSLATIONS: fetchmail's translation was updated, courtesy of:
    * es:    Cristian Othón Martínez Vera [Spanish]

    PR:             287435
    MFH:            2025Q2
    Approved by:    Corey Halpin (maintainer)

 mail/fetchmail/Makefile                      |  2 +-
 mail/fetchmail/distinfo                      |  6 ++---
 mail/fetchmail/files/patch-fetchmail.c (new) | 35 ++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 4 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2025-06-11 17:59:43 UTC
A commit in branch 2025Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=59de7e9e3cea14dac0fc336a2c112bff39349ae4

commit 59de7e9e3cea14dac0fc336a2c112bff39349ae4
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2025-06-10 20:21:13 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2025-06-11 17:59:10 +0000

    mail/fetchmail: update to 6.5.3

    = BUGFIXES:
    * IMAP: Reinstate workaround for missing IDLE support if --idle is requested.
      This had been a long-standing feature but got broken in fetchmail 6.4.22
      (commit 616e8c70).  Thanks to Lukáš Tesař for the detailed report including
      a Git bisect that identified this faulty commit.  Fixes Gitlab issue #69.
    * IMAP: Only print 'will idle after poll' if --idle is enabled
      and either offered by the server, or forced through --forceidle.
      This fixes a regression introduced in fetchmail 6.4.22 (commit 616e8c70).

    = TRANSLATIONS: fetchmail's translation was updated, courtesy of:
    * es:    Cristian Othón Martínez Vera [Spanish]

    PR:             287435
    MFH:            2025Q2
    Approved by:    Corey Halpin (maintainer)

    (cherry picked from commit fd5d3db1d45fee8a8683ff5bedf12e461d0cb16a)

 mail/fetchmail/Makefile                      |  2 +-
 mail/fetchmail/distinfo                      |  6 ++---
 mail/fetchmail/files/patch-fetchmail.c (new) | 35 ++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 4 deletions(-)
Comment 8 Matthias Andree freebsd_committer freebsd_triage 2025-06-11 18:00:47 UTC
Thanks Corey for reviews, feedback, testing, and approval!