Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

undefined reference to `closefrom' when compiling from source

60 views
Skip to first unread message

Tyler Montney

unread,
Oct 7, 2021, 9:29:16 PM10/7/21
to
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/postfi...@postfix.org/msg92244.html

Tyler Montney

unread,
Oct 7, 2021, 9:30:32 PM10/7/21
to
Sorry, if it needs to be clarified, the error appears when I run 'make'.

Tyler Montney

unread,
Oct 7, 2021, 10:35:11 PM10/7/21
to
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

unread,
Oct 8, 2021, 2:06:07 AM10/8/21
to
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.
0 new messages