Mac OS X 10.3 (Panther) ships with the Postfix Mail Transport Agent (MTA). To use Sendmail instead, compile Sendmail from source. I use Sendmail on Mac OS X 10.3 as I could not get Postfix to properly relay e-mail via Transport Layer Security (TLS) using a custom Certificate Authority.
These pages do not cover Mac OS X Server as I do not have access to it.
Installation
Always verify the Pretty Good Privacy (PGP) signature on the Sendmail distribution before attempting to build Sendmail.
The Apple Developer Tools (XCode) will need to be installed on the system being used to build Sendmail. Also, the compiler in use may make a difference. Use the gcc_select utility to change the version of gcc used, and long list the gcc file to see which version is currently selected.
$ ls -l /usr/bin/gcc
lrwxr-xr-x 1 root wheel 7 2 Feb 08:29 /usr/bin/gcc -> gcc-3.3
Sendmail 8.12.11 supports Mac OS X 10.3 (Darwin 7), though needs certain Build options to compile properly on the most recent release of Mac OS X (Darwin 7.2.0).
- Set os and rel build flags.
- Disable unused protocols (optional).
When running the Sendmail Build script, set the os and rel options to ensure the proper configuration file for Darwin is selected, as otherwise Sendmail uses the wrong definitions file.
$ sh Build -c -f /etc/mail/site.config.m4 -E os=Darwin -E rel=7.0
$ sudo sh Build install -E os=Darwin -E rel=7.0
The -c option tries to do a clean build, though starting from a clean tarball unpack may be safer. The site.config.m4 file allows various parameters of the Sendmail build to be set, such as MILTER or STARTTLS support.
Sendmail 8.12.11 builds in Network Information Service (NIS) support by default. Alternatives with fewer security problems include files local to the host, the Lightweight Directory Access Protocol (LDAP), or a MILTER program that handles e-mail routing. To evict NIS support from sendmail, remove the -DNIS define from the operating system support file for the system in question, then rebuild Sendmail.
$ perl -i -ple 's/ -DNIS//g' devtools/OS/Darwin*
If only flat files or MILTER will be used, consider also disabling NetInfo support.
$ perl -i -ple 's/ -DNETINFO -DAUTO_NETINFO_ALIASES -DAUTO_NETINFO_HOSTS//g' \
devtools/OS/Darwin*
To test whether sendmail built, check the obj* directory under the Sendmail source tree for a sendmail binary.
$ file obj*/sendmail/sendmail
obj.Darwin.7.0./sendmail/sendmail: Mach-O executable ppc
To reinstall the system-wide configuration files to where Apple kept them in previous releases of Mac OS X, use the following command from the sendmail source directory.
The rsync command behaves differently if the trailing slash on cf/ is removed.
# rsync --delete -rutvz cf/ /usr/share/sendmail/conf
After updating the above configuration files, rebuild sendmail.cf and submit.cf, then restart sendmail.
Configuration
Use the sendmail source tools for building the configuration files, or use my Sendmail configurations. Some configuration pointers:
- The OSTYPE for Mac OS X is Darwin.
- Allow group writable directories.
OSTYPE(`Darwin')
Apple uses group writable directories by default on Mac OS X, either fix the permissions, or allow the group write permissions with the following to be set in both sendmail.mc and submit.mc.
define(`confDONT_BLAME_SENDMAIL', `GroupWritableDirPathSafe')
MAILER(`smtp')
Be sure to disable the Postfix MTA in /etc/hostconfig, and use an @reboot or proper startup script to launch sendmail if running it as a daemon.
$ grep MAILSERVER /etc/hostconfig
MAILSERVER=-NO-
Related
- SMTP AUTH and STARTTLS - presentation of the said e-mail protocols and their implementation in the Sendmail MTA.
- Relaying with TLS in Sendmail - how I configure my OS X laptop to do roaming TLS encrypted e-mail relaying through my main e-mail server.