Building static binaries for msmtp and msmtpd using alpine linux on docker
#obsolete see compiling-static-binaries instead.
Create a local build folder and mount it inside the alpine linux container
mkdir /tmp/build
docker run --rm -ti -v /tmp/build:/build alpine:3 shInstall build dependency packages in alpine, download the latest msmtp release from https://marlam.de/msmtp/ and build it.
apk add build-base openssl-dev openssl-libs-static autoconf automake libtool gettext-dev texinfo
cd /build
wget https://marlam.de/msmtp/releases/msmtp-1.8.15.tar.xz
tar xf msmtp-1.8.15.tar.xz
cd msmtp-1.8.15
export CLAGS='-static'
export LDFLAGS='-static'
autoreconf -i
./configure --with-tls=openssl
make
strip src/msmtp
strip src/msmtpd
# Static binaries are now in src/msmtp and src/msmtpd