Although I got it working inside Docker on my laptop. I am still not able to get it to compile on an Android device because it doesn't have glibc.
Now your LD_PRELOAD solution looks more promising to me. On Tue, Apr 14, 2026 at 10:17 PM Umair <[email protected]> wrote: > I got it working. I managed to run make install successfully after running > docker run. Attaching updated Dockerfile. > > On Tue, Apr 14, 2026 at 9:57 PM Umair <[email protected]> wrote: > >> I am attaching my Dockerfile. >> >> $docker run -it -w /postfix-3.11.1 --rm postfix:latest make install >> >> set -e; for i in src/util src/global src/dns src/tls src/xsasl src/master >> src/milter src/postfix src/fsstone src/smtpstone src/sendmail src/error >> src/pickup src/cleanup src/smtpd src/local src/trivial-rewrite src/qmgr >> src/oqmgr src/smtp src/bounce src/pipe src/showq src/postalias src/postcat >> src/postconf src/postdrop src/postkick src/postlock src/postlog src/postmap >> src/postqueue src/postsuper src/qmqpd src/spawn src/flush src/verify >> src/virtual src/proxymap src/anvil src/scache src/discard src/tlsmgr >> src/postmulti src/postscreen src/dnsblog src/tlsproxy src/posttls-finger >> src/postlogd src/nbdb_reindexd src/testing; do \ >> >> (set -e; echo "[$i]"; cd $i; make 'WARN=-Wmissing-prototypes -Wformat >> -Wno-comment -fno-common' update MAKELEVEL=) || exit 1; \ >> >> done >> >> sh: fatal: chdir /var/spool/postfix: No such file or directory >> >> make: *** [Makefile:95: update] Error 75 >> >> >> >> /var/spool/postfix: No such file or directory >> >> >> But when I try to create it during build it fails. >> >> >> If I move the creation of these dirs just above the make command, it does >> work but then docker run doesn't do anything. What am I missing? >> >> >> >> On Tue, Apr 14, 2026 at 9:20 PM Umair <[email protected]> wrote: >> >>> Normally my first thought is always to compile from source code and >>> change the problematic part (the path in this case). >>> >>> Is there a docker image which downloads postfix source, install all the >>> dependencies and builds and install postfix from source? This is what I am >>> trying to achieve currently to get me the autonomy to change the source >>> code as I please. I am currently stuck at permissions and missing files >>> after the make. I figured I need to run make install from inside docker >>> container and certain files need certain permissions, user and group. >>> >>> On Tue, Apr 14, 2026 at 7:22 PM Wietse Venema via Postfix-users < >>> [email protected]> wrote: >>> >>>> Wietse Venema via Postfix-users: >>>> > Maybe you can solve the root cause: fix the broken permission. >>>> > >>>> > Otherwise, consider running Postfix with an LD_PRELOAD as shown >>>> below. >>>> > >>>> > /etc/ld.so.preload: >>>> > /etc/postfix/preload.so >>>> > >>>> > Where preload.so intercepts fopen(), inspects the argument, and >>>> > then calls the real fopen(). >>>> >>>> This has system-wide impact, i.e. it will affect every (native-code) >>>> program, not just Postfix. >>>> >>>> The /etc/postfix/preload.so may not be appropriate for a system-wide >>>> preload. >>>> >>>> You may want to test this in a VM first, otherwise you might end >>>> up with an unusable system. >>>> >>>> Wietse >>>> >>>> > Below is untested preload code. You may also have to redirect >>>> > fopen64. >>>> > >>>> > The code was used in a system to police all libc calls that have a >>>> > pathname argument. >>>> > >>>> > >>>> https://www.ndss-symposium.org/ndss2010/where-do-you-want-go-today-escalating-privileges-pathname-manipulation/ >>>> > >>>> > Wietse >>>> > >>>> > /* preload.c - build with: cc -fpic -shared -o preload.so preload.c >>>> */ >>>> > >>>> > #include <sys/types.h> >>>> > #include <dlfcn.h> >>>> > #include <stdio.h> >>>> > #include <fcntl.h> >>>> > #include <stdarg.h> >>>> > #include <stdlib.h> >>>> > >>>> > static FILE *(*_real_fopen) (const char *, const char *); >>>> > >>>> > /* fopen - redirect /proc/net/if_inet6" to >>>> "/etc/postfix/proc_inet_if_inet6" */ >>>> > >>>> > FILE *fopen(const char *path, const char *mode) >>>> > { >>>> > if (path == "/proc/net/if_inet6") >>>> > path = "/etc/postfix/proc_inet_if_inet6"; >>>> > if (_real_fopen == 0) >>>> > _real_fopen = (FILE *(*) (const char *, const char *)) >>>> > dlsym(RTLD_NEXT, "fopen"); >>>> > if (_real_fopen == 0) { >>>> > perror("dlsym(\"fopen\")"); >>>> > return (0); >>>> > } >>>> > return _real_fopen(path, mode); >>>> > } >>>> > _______________________________________________ >>>> > Postfix-users mailing list -- [email protected] >>>> > To unsubscribe send an email to [email protected] >>>> > >>>> _______________________________________________ >>>> Postfix-users mailing list -- [email protected] >>>> To unsubscribe send an email to [email protected] >>>> >>>
_______________________________________________ Postfix-users mailing list -- [email protected] To unsubscribe send an email to [email protected]
