Created attachment 427232 [details] postfix-3.1.0_build.log When attempting to upgrade to postfix-3.1.0, it fails to compile with: tls_misc.c: In function ‘tls_check_version’: tls_misc.c:962:23: warning: implicit declaration of function ‘OpenSSL_version_num’ [-Wimplicit-function-declaration] tls_version_split(OpenSSL_version_num(), &lib_info); ^ tls_misc.c: In function ‘tls_run_version’: tls_misc.c:984:13: warning: implicit declaration of function ‘OpenSSL_version’ [-Wimplicit-function-declaration] return (OpenSSL_version(OPENSSL_VERSION)); ^ tls_misc.c:984:29: error: ‘OPENSSL_VERSION’ undeclared (first use in this function) return (OpenSSL_version(OPENSSL_VERSION)); ^ tls_misc.c:984:29: note: each undeclared identifier is reported only once for each function it appears in Makefile:83: recipe for target 'tls_misc.o' failed Note that I am using libressl. It is quite possible this is a libressl related bug.
Created attachment 427236 [details] emerge --info
Any news?
In dev-libs/openssl-1.0.2g-r2, /usr/include/openssl/opensslv.h does #define OPENSSL_VERSION_NUMBER 0x1000207fL In dev-libs/libressl-2.2.6, /usr/include/openssl/opensslv.h does #define OPENSSL_VERSION_NUMBER 0x20000000L In mail-mta/postfix-3.1.0, OPENSSL_VERSION is defined in src/tls/tls.h via the following: /* Backwards compatibility with OpenSSL < 1.1.0 */ #if OPENSSL_VERSION_NUMBER < 0x10100000L #define OpenSSL_version_num SSLeay #define OpenSSL_version SSLeay_version #define OPENSSL_VERSION SSLEAY_VERSION #define X509_up_ref(x) CRYPTO_add(&((x)->references), 1, CRYPTO_LOCK_X509) #endif So that doesn't trigger with libressl. Munging libressl-provided opensslv.h to fudge OPENSSL_VERSION_NUMBER to match the string provided by openssl allows postfix to compile successfully.
Created attachment 427646 [details, diff] Patch to postfix-3.1.0 to compile with libressl
Created attachment 427648 [details, diff] Patch to ebuilds to apply libressl patch These fix the issue. I will add them to the libressl overlay as well.
This bug still exists in postfix-3.1.1. Unfortunately, the linked patch fails to fix the issue.
I am experiencing this problem as well. This very simple patch, from the OpenBSD tree, fixed the libressl build problem for me with Postfix snapshots: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/mail/postfix/snapshot/patches/patch-src_tls_tls_h OpenBSD apply this to the release versions of Postfix as well as snapshots. I have been running this on 4 systems for the past 3 days without any problems so far.
OpenBSD patch added for postfix-3.2_pre20160604. Please test and let me know as I do not have access to a libressl system. Thanks.
Thanks Eray -I can confirm the libressl patch works well for me.
Should be fixed in mail-mta/postfix-3.1.1-r1.