Discussion:
undefined reference to `closefrom' when compiling from source
(too old to reply)
Tyler Montney
2021-10-08 01:29:15 UTC
Permalink
Trying to compile from source to get a more recent version of Postfix (the repo version is from 2019). My goal is to compile Postfix with TLS, LDAP (really Active Directory), and Dovecot SASL support. Here's what I've done to prep my Ubuntu 18 server:

########################################
sudo groupadd -g 32 postfix
sudo groupadd -g 33 postdrop
sudo useradd -c "Postfix Daemon User" -d /var/spool/postfix -g postfix -s /bin/false -u 32 postfix

sudo mkdir /srv/mail
sudo chown -v postfix:postfix /srv/mail

wget http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/postfix-3.6.2.tar.gz

tar xzf postfix-3.6.2.tar.gz
sudo apt-get install libdb-dev gcc m4 make libsasl2-dev openssl libssl-dev libldb-dev libldap2- dev

cd postfix-3.6.2/
make makefiles CCARGS="-I/usr/include/openssl -I/usr/include/sasl/ -DUSE_TLS -DHAS_LDAP -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DDEF_SERVER_SASL_TYPE=\"dovecot\"" AUXLIBS="-lssl -lcrypto -lldap -llber -lsasl2"

make
sudo make install
########################################

I've seen two suggestions on similar results, neither help:

1) sed -i '/<linux/i #define HAS_CLOSEFROM' src/util/sys_defs.h
2) https://www.mail-archive.com/postfix-***@postfix.org/msg92244.html
Tyler Montney
2021-10-08 01:30:31 UTC
Permalink
Sorry, if it needs to be clarified, the error appears when I run 'make'.
Tyler Montney
2021-10-08 02:35:09 UTC
Permalink
I decided to remove and redownload. I am able to compile with just "make makefiles && make". Tried with my original, and received something else:

<command-line>:0:22: error: ‘dovecot’ undeclared (first use in this function); did you mean ‘iovec’?
../../include/mail_params.h:1694:29: note: in expansion of macro ‘DEF_SERVER_SASL_TYPE’
Tyler Montney
2021-10-08 06:06:05 UTC
Permalink
Ended up using...

make makefiles CCARGS="-I/usr/include/openssl -I/usr/include/sasl/ -DUSE_TLS -DHAS_LDAP -DUSE_SASL_AUTH -DUSE_CYRUS_SASL" AUXLIBS="-lssl -lcrypto -lldap -llber -lsasl2"

Consider this closed.

Loading...