postfix 3.1.4 on Apple 10.12.2 Sierra

This is the makefile command line. I copy this line – it is 1 line of pure text – and press enter from the prompt.

Don’t just do it unless you have the appropriate libraries installed. It’s a long job getting to here.

This line also installs postfix OUTSIDE of the default Apple location for Postfix. That way it’s not overwritten each time you update the OS.

 make -f Makefile.init dynamicmaps=yes CCARGS='-DHAS_MYSQL -I/usr/local/include/mysql -DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/opt/local/include/sasl -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DHAS_PCRE -I/opt/local/include -DEF_COMMAND_DIR=\"/usr/local/sbin\" -DEF_CONGIG_DIR=\"/usr/local/etc/postfix\" -DEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" -DEF_DATA_DIR=\"/var/lib/postfix\" -DEF_MAILQ_PATH=\"/usr/local/bin/mailq\" -DEF_HTML_DIR=\"/usr/share/doc/postfix/html\" -DEF_MANPAGE_DIR=\"/usr/local/man\" -DEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" -DEF_QUEUE_DIR=\"/private/var/spool/postfix\" -DEF_README_DIR=\"/usr/share/doc/postfix\" -DEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\"' 'AUXLIBS=-L/opt/local/lib -lsasl2 -lssl -lcrypto -licuuc' 'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm' 'AUXLIBS_PCRE=-L/opt/local/lib -lpcre' command_directory=/usr/local/sbin config_directory=/usr/local/etc/postfix meta_directory=/usr/local/etc/postfix daemon_directory=/usr/local/libexec/postfix mailq_path=/usr/bin/mailq newaliases_path=/usr/bin/newaliases sendmail_path=/usr/local/sbin/sendmail shlib_directory=/usr/local/lib/postfix 

The plist file to start it is kept in /Library/LaunchDaemons/org.postfix.master.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>org.postfix.master</string>
        <key>Program</key>
        <string>/usr/local/libexec/postfix/master</string>
        <key>ProgramArguments</key>
        <array>
                <string>master</string>
        </array>
                <key>RunAtLoad</key>
        <true/>
         <key>KeepAlive</key>
                         <false/>
</dict>
</plist>