Solved Trouble with jail? Trying to make /usr/ports/mail/postfix with SASL and MYSQL in jail..

Hello!

My ancient freebsd13 mail host stop being able to receive emails this week, so the long delayed upgrade to 15-RELEASE has been ongoing is sort of panic mode..

When I try to compile postfix to support mysql and sasl I'm getting the following errors that I don't understand.. (be patient with me - an accident a few years ago left me a little brain damaged to my undending dissapointment..)
Code:
[root@mailhost:/usr/ports/mail/postfix]# make
===>  License EPL IPL10 accepted by the user
===>   postfix-3.11.3,1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by postfix-3.11.3,1 for building
===>  Extracting for postfix-3.11.3,1
===>  License EPL IPL10 accepted by the user
===>   postfix-3.11.3,1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by postfix-3.11.3,1 for building
=> SHA256 Checksum OK for postfix/postfix-3.11.3.tar.gz.
tar: Failed to set default locale
===>  Patching for postfix-3.11.3,1
===>  Applying extra patch /basejail/usr/ports/mail/postfix/files/extra-patch-blocklistd
===>  Applying FreeBSD patches for postfix-3.11.3,1 from /basejail/usr/ports/mail/postfix/files
===>   postfix-3.11.3,1 depends on file: /usr/local/lib/libcrypto.so.12 - found
===>   postfix-3.11.3,1 depends on shared library: libcdb.sofile: could not find any valid magic files! (No such file or directory)
 - not found
===>   postfix-3.11.3,1 depends on shared library: libcdb.sofile: could not find any valid magic files! (No such file or directory)
 - not found
*** Error code 1

Stop.
make[2]: stopped making "build-depends lib-depends configure-message apply-slist run-autotools-fixup do-configure" in /basejail/usr/ports/mail/postfix
*** Error code 1

Stop.
make[1]: stopped making "/var/ports/basejail/usr/ports/mail/postfix/work-default/.stage_done.postfix._usr_local" in /basejail/usr/ports/mail/postfix
*** Error code 1

Stop.
make: stopped making "all" in /basejail/usr/ports/mail/postfix
[root@mailhost:/usr/ports/mail/postfix]# pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (73 candidates): 100%
Processing candidates (73 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
[root@mailhost:/usr/ports/mail/postfix]# uname -a
FreeBSD mailhost 15.0-RELEASE-p5 FreeBSD 15.0-RELEASE-p5 GENERIC amd64
[root@mailhost:/usr/ports/mail/postfix]#

I have thrown myself at this for some time now and while my MX piles up mail, I just can't seem to figure this out..
Code:
[root@mailhost:/usr/lib]# pkg info|grep cdb
cdb-20251021                   Fast lookup database library & utilities
libcdb-g2020082801             Constant database library
[root@mailhost:/usr/lib]#
[root@mailhost:/usr/lib]# ls -l /usr/local/lib/libcdb*
-rw-r--r--  1 root wheel 66612 May 23 00:41 /usr/local/lib/libcdb.a
lrwxr-xr-x  1 root wheel    15 May 23 00:41 /usr/local/lib/libcdb.so -> libcdb.so.1.0.0
lrwxr-xr-x  1 root wheel    15 May 23 00:41 /usr/local/lib/libcdb.so.1 -> libcdb.so.1.0.0
-rwxr-xr-x  1 root wheel 52448 May 23 00:41 /usr/local/lib/libcdb.so.1.0.0
[root@mailhost:/usr/lib]#

I'm just sitting here repeating myself over and over and getting headache - time to reach out to those who know!

I'm 100% certain this is something stupid, but my broken brain isn't doing me any favors today..

Thanks so much for any suggestions!

Oh, I can get the static postfix package to install, but I need BOTH sasl and mysql support, and as I sort of recall, doing a make config, selecting mysql and sasl and "make install" was all I did on the vesion 13 host.. (oh, then locked the package. Worked for over a decade!!)

Code:
[root@mailhost:/usr/lib]# freebsd-version
15.0-RELEASE-p5
[root@mailhost:/usr/lib]# pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (73 candidates): 100%
Processing candidates (73 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
[root@mailhost:/usr/lib]#
 
Code:
=> SHA256 Checksum OK for postfix/postfix-3.11.3.tar.gz.
tar: Failed to set default locale
What locale(1) are you using?

Code:
===> postfix-3.11.3,1 depends on file: /usr/local/lib/libcrypto.so.12 - found
pkg delete openssl

I suspect you once installed it because 13.x was stuck on OpenSSL 1.1.1. FreeBSD 15 has OpenSSL 3.5.x, so you can revert back to the base OpenSSL.
 
Code:
[QUOTE="SirDice, post: 762001, member: 1677"]
=> SHA256 Checksum OK for postfix/postfix-3.11.3.tar.gz.
tar: Failed to set default locale
What locale(1) are you using?

Code:
===> postfix-3.11.3,1 depends on file: /usr/local/lib/libcrypto.so.12 - found
pkg delete openssl

I suspect you once installed it because 13.x was stuck on OpenSSL 1.1.1. FreeBSD 15 has OpenSSL 3.5.x, so you can revert back to the base OpenSSL.
[/QUOTE]

Hello! Okay, more progress, but as usual, I make it just a LITTLE further.

I took your advice on removing OpenSSL, but then the mysql tried to build that from ports and fails, so I put it back.

I set the locale for root:
root@laatikko:~ # locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=
root@laatikko:~ #
I was using zsh, so I changed it back to /bin/sh, just in case..

# echo $SHELL
/bin/sh
#

And now when I run make, I get a "no system rules" sort of error? Not clear how to fix that?

# make showconfig
===> The following configuration options are available for postfix-3.11.3,1:
BDB=off: Berkeley DB support
BLOCKLISTD=on: Enable blocklistd support
CDB=on: CDB maps lookups
DOCS=on: Build and/or install documentation
EAI=on: Email Address Internationalization (SMTPUTF8) support
INST_BASE=off: Install into /usr and /etc/postfix
LDAP=off: LDAP maps (uses WITH_OPENLDAP_VER)
LMDB=on: LMDB maps
MONGO=off: MongoDB support
MYSQL=on: MySQL database support
NIS=off: Network Information Services/YP support
PCRE2=on: Use Perl Compatible Regular Expressions, version 2
PGSQL=off: PostgreSQL database support
SASL=on: Cyrus SASL support (Dovecot SASL is always built in)
SQLITE=off: SQLite database support
TEST=off: SMTP/LMTP test server and generator
TLS=on: Secure network connection support via TLS
TLSRPT=on: Enable sending RFC 8460 TLS reports
====> Kerberos network authentication protocol type: you can only select none or one of them
SASLKMIT=off: If your SASL req. MIT Kerberos5, select this
SASLKRB5=off: If your SASL req. Kerberos5, select this
===> Use 'make config' to modify these settings
# make
===> License EPL IPL10 accepted by the user
===> postfix-3.11.3,1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by postfix-3.11.3,1 for building
===> Extracting for postfix-3.11.3,1
===> License EPL IPL10 accepted by the user
===> postfix-3.11.3,1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by postfix-3.11.3,1 for building
=> SHA256 Checksum OK for postfix/postfix-3.11.3.tar.gz.
tar: Failed to set default locale
===> Patching for postfix-3.11.3,1
===> Applying extra patch /basejail/usr/ports/mail/postfix/files/extra-patch-blocklistd
===> Applying FreeBSD patches for postfix-3.11.3,1 from /basejail/usr/ports/mail/postfix/files
===> postfix-3.11.3,1 depends on file: /usr/local/lib/libcrypto.so.12 - found
===> postfix-3.11.3,1 depends on shared library: libcdb.so - found (/usr/local/lib/libcdb.so)
===> postfix-3.11.3,1 depends on shared library: libicuuc.so - found (/usr/local/lib/libicuuc.so)
===> postfix-3.11.3,1 depends on shared library: liblmdb.so - found (/usr/local/lib/liblmdb.so)
===> postfix-3.11.3,1 depends on shared library: libpcre2-8.so - found (/usr/local/lib/libpcre2-8.so)
===> postfix-3.11.3,1 depends on shared library: libsasl2.so - found (/usr/local/lib/libsasl2.so)
===> postfix-3.11.3,1 depends on shared library: libtlsrpt.so - found (/usr/local/lib/libtlsrpt.so)
===> postfix-3.11.3,1 depends on shared library: libmysqlclient.so.24 - found (/usr/local/lib/mysql/libmysqlclient.so.24)
===> Configuring for postfix-3.11.3,1
make -C /var/ports/basejail/usr/ports/mail/postfix/work-default/postfix-3.11.3 -f Makefile.init makefiles DEBUG= pie=yes CC="cc" OPT="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " CCARGS="-DDEF_CONFIG_DIR=\\\"/usr/local/etc/postfix\\\" -DDEF_DAEMON_DIR=\\\"/usr/local/libexec/postfix\\\" -DDEF_META_DIR=\\\"/usr/local/libexec/postfix\\\" -DDEF_COMMAND_DIR=\\\"/usr/local/sbin\\\" -DDEF_SENDMAIL_PATH=\\\"/usr/local/sbin/sendmail\\\" -DDEF_NEWALIAS_PATH=\\\"/usr/local/bin/newaliases\\\" -DDEF_MAILQ_PATH=\\\"/usr/local/bin/mailq\\\" -DDEF_MANPAGE_DIR=\\\"/usr/local/share/man\\\" -DDEF_README_DIR=\\\"/usr/local/share/doc/postfix\\\" -DDEF_HTML_DIR=\\\"/usr/local/share/doc/postfix\\\" -DDEF_QUEUE_DIR=\\\"/var/spool/postfix\\\" -DDEF_DATA_DIR=\\\"/var/db/postfix\\\" -DDEF_MAIL_OWNER=\\\"postfix\\\" -DDEF_SGID_GROUP=\\\"maildrop\\\" -Wmissing-prototypes -Wformat -Wno-comment -DUSE_SASL_AUTH -DHAS_EAI -I/usr/local/include -DHAS_PCRE=2 -I/usr/local/include -DUSE_CYRUS_SASL -I/usr/local/include -I/usr/local/include/sasl -DUSE_TLS -I/usr/local/include -DUSE_TLSRPT -I/usr/local/include -DHAS_MYSQL -I/usr/local/include/mysql -DHAS_CDB -I/usr/local/include -DHAS_LMDB -I/usr/local/include" shared=yes shlib_directory=/usr/local/lib/postfix dynamicmaps=yes "AUXLIBS_PCRE=`/usr/local/bin/pcre2-config --libs8`" "AUXLIBS_MYSQL=-L/usr/local/lib/mysql -lmysqlclient -lz -lm" "AUXLIBS_CDB=-L/usr/local/lib -lcdb" "AUXLIBS_LMDB=-L/usr/local/lib -llmdb" AUXLIBS="-L/usr/local/lib -licuuc -L/usr/local/lib -lsasl2 -lpam -lcrypt -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lssl -lcrypto -L/usr/local/lib -Wl,-rpath,/usr/local/lib -ltlsrpt -lblocklist"
make[3]: make[3]: no system rules (sys.mk).

make[3]: stopped making "makefiles" in /var/ports/basejail/usr/ports/mail/postfix/work-default/postfix-3.11.3
*** Error code 2

Stop.
make[2]: stopped making "build-depends lib-depends configure-message apply-slist run-autotools-fixup do-configure" in /basejail/usr/ports/mail/postfix
*** Error code 1

Stop.
make[1]: stopped making "/var/ports/basejail/usr/ports/mail/postfix/work-default/.stage_done.postfix._usr_local" in /basejail/usr/ports/mail/postfix
*** Error code 1

Stop.
make: stopped making "all" in /basejail/usr/ports/mail/postfix
#

And now my errors have changed.. Which is good? ;-)

Sooo... Closer, but still no go..
 
After my last post: "no system rules" seems to AGAIN point at my jail configuration, but I have not the slightest clue in the world how to go about repairing it.. From a standard system utility POV every thing seems fine - packages are up to date, version check work.. Sigh..

My base machine has /usr/src/share/mk fully populated with "stuff". The jail, on the other hand has nothing:

# cd /usr/src
# ls
contrib
# pwd
/usr/src
#

interwe AI has at least something to say about missing /usr/src/share - working to implement that now, more shortly..

THANK YOU for your kind responses! You are helping!!
 
Well, I return to the stumped state..

# make
===> postfix-3.11.3,1 depends on file: /usr/local/lib/libcrypto.so.12 - found
===> postfix-3.11.3,1 depends on shared library: libcdb.so - found (/usr/local/lib/libcdb.so)
===> postfix-3.11.3,1 depends on shared library: libicuuc.so - found (/usr/local/lib/libicuuc.so)
===> postfix-3.11.3,1 depends on shared library: liblmdb.so - found (/usr/local/lib/liblmdb.so)
===> postfix-3.11.3,1 depends on shared library: libpcre2-8.so - found (/usr/local/lib/libpcre2-8.so)
===> postfix-3.11.3,1 depends on shared library: libsasl2.so - found (/usr/local/lib/libsasl2.so)
===> postfix-3.11.3,1 depends on shared library: libtlsrpt.so - found (/usr/local/lib/libtlsrpt.so)
===> postfix-3.11.3,1 depends on shared library: libmysqlclient.so.24 - found (/usr/local/lib/mysql/libmysqlclient.so.24)
===> Configuring for postfix-3.11.3,1
make -C /var/ports/basejail/usr/ports/mail/postfix/work-default/postfix-3.11.3 -f Makefile.init makefiles DEBUG= pie=yes CC="cc" OPT="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " CCARGS="-DDEF_CONFIG_DIR=\\\"/usr/local/etc/postfix\\\" -DDEF_DAEMON_DIR=\\\"/usr/local/libexec/postfix\\\" -DDEF_META_DIR=\\\"/usr/local/libexec/postfix\\\" -DDEF_COMMAND_DIR=\\\"/usr/local/sbin\\\" -DDEF_SENDMAIL_PATH=\\\"/usr/local/sbin/sendmail\\\" -DDEF_NEWALIAS_PATH=\\\"/usr/local/bin/newaliases\\\" -DDEF_MAILQ_PATH=\\\"/usr/local/bin/mailq\\\" -DDEF_MANPAGE_DIR=\\\"/usr/local/share/man\\\" -DDEF_README_DIR=\\\"/usr/local/share/doc/postfix\\\" -DDEF_HTML_DIR=\\\"/usr/local/share/doc/postfix\\\" -DDEF_QUEUE_DIR=\\\"/var/spool/postfix\\\" -DDEF_DATA_DIR=\\\"/var/db/postfix\\\" -DDEF_MAIL_OWNER=\\\"postfix\\\" -DDEF_SGID_GROUP=\\\"maildrop\\\" -Wmissing-prototypes -Wformat -Wno-comment -DUSE_SASL_AUTH -DHAS_EAI -I/usr/local/include -DHAS_PCRE=2 -I/usr/local/include -DUSE_CYRUS_SASL -I/usr/local/include -I/usr/local/include/sasl -DUSE_TLS -I/usr/local/include -DUSE_TLSRPT -I/usr/local/include -DHAS_MYSQL -I/usr/local/include/mysql -DHAS_CDB -I/usr/local/include -DHAS_LMDB -I/usr/local/include" shared=yes shlib_directory=/usr/local/lib/postfix dynamicmaps=yes "AUXLIBS_PCRE=`/usr/local/bin/pcre2-config --libs8`" "AUXLIBS_MYSQL=-L/usr/local/lib/mysql -lmysqlclient -lz -lm" "AUXLIBS_CDB=-L/usr/local/lib -lcdb" "AUXLIBS_LMDB=-L/usr/local/lib -llmdb" AUXLIBS="-L/usr/local/lib -licuuc -L/usr/local/lib -lsasl2 -lpam -lcrypt -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lssl -lcrypto -L/usr/local/lib -Wl,-rpath,/usr/local/lib -ltlsrpt -lblocklist"
make[3]: make[3]: no system rules (sys.mk).

make[3]: stopped making "makefiles" in /var/ports/basejail/usr/ports/mail/postfix/work-default/postfix-3.11.3
*** Error code 2

Stop.
make[2]: stopped making "build-depends lib-depends configure-message apply-slist run-autotools-fixup do-configure" in /basejail/usr/ports/mail/postfix
*** Error code 1

Stop.
make[1]: stopped making "/var/ports/basejail/usr/ports/mail/postfix/work-default/.stage_done.postfix._usr_local" in /basejail/usr/ports/mail/postfix
*** Error code 1

Stop.
make: stopped making "all" in /basejail/usr/ports/mail/postfix
#
# file /usr/src/share/mk/sys.mk
/usr/src/share/mk/sys.mk: troff or preprocessor input, ASCII text
# ls -ld /usr/src/share/mk/sys.mk
-rw-r--r-- 1 root wheel 8105 May 31 10:03 /usr/src/share/mk/sys.mk
#

I THOUGHT I was making progress, but I simply don't understand what the error is trying to tell me?
 
OMG - FINALLY.. The issue was missing/stale links in the base jail.. Once I tracked those all down, I was able to compile/install and start AND..
Wait for it.. Bingo! sessions between my mailhost and the upstream MX host are working once again!

I still have an issue, but it doesn't pertain to this forum, but more the dovecot "where the (*&^ did you just put all that new mail?" forum.

THANK YOU for the responses and paitience with my damaged head!!
 
Back
Top