pymilter on OS X 10.10

As a python developer I wanted to install pymilter. This failed, because it needed libmilter.dylib. I searched all over and finally found a MacPorts snippet on

As a Homebrew user I could not use this and therefor created the library manually.

1. Get sendmail from (As of this writing I found version 8.15.1)
2. Create a source folder where you want to unpack the source code. In my case it is /Users/croessner/src
3. Building the library:

cd /Users/croessner/sendmail-8.15.1/devtools/OS/
cp Darwin.13.x Darwin.14.x
cd /Users/croessner/sendmail-8.15.1/libmilter
sh ./Build -O $PWD/mybuild
cd mybuild/obj.Darwin.14.4.0.x86_64/libmilter
touch /Users/croessner/src/sendmail-8.15.1/include/sm_os.h
cc -pipe -O3 -fno-common -I. -I/Users/croessner/src/sendmail-8.15.1/sendmail -I/Users/croessner/src/sendmail-8.15.1/include -DDARWIN=130000 -DBIND_8_COMPAT -DNETINET6 -DNOT_SENDMAIL -Dsm_snprintf=snprintf -D_THREAD_SAFE -DXP_MT -c *.c
cc -pipe -O3 -fno-common -dynamiclib -install_name /usr/local/lib/libmilter.dylib -compatibility_version 8.15 -current_version 8.15.1 -o libmilter.dylib comm.o engine.o errstring.o example.o handler.o listener.o main.o monitor.o signal.o sm_gethost.o smfi.o strl.o

4. Install it:

Asuming you have write permissions (as Homebrew user I can do this without sudo):

cp libmilter.dylib /usr/local/lib/
cd /Users/croessner/src/sendmail-8.15.1/include
cp -r libmilter /usr/local/include/
cd /usr/local/include/libmilter/
rm milter.h

5. Finally you can install pymilter:

pip install pymilter