Postfix

As of Mac OS X Panther, setting up a local mail server just got a lot easier. Apple has given up on the aging and clunky sendmail, and is instead using Postfix, which is easy to configure. (However, Postfix includes a sendmail-compatibility wrapper in /usr/sbin/sendmail.) The following sections describe how to configure Postfix in various scenarios.

Tip

After you make any changes to Postfix’s configuration files, you should reload its configuration by running the command sudo postfix reload.

Configuring Postfix to Send Email

By default, Mac OS X runs a program called postfix-watch , which corresponds to the MAILSERVER=-AUTOMATIC- in /etc/hostconfig (a setting of -YES- starts the postfix server). The postfix-watch daemon monitors the outgoing mail queue, and runs Postfix on the queue as needed.

If you want to use Postfix on a standalone server, you must configure two settings in /etc/postfix/main.cf . The first is the hostname (myhostname ). This should be a real hostname, something that can be found in a reverse DNS lookup against your IP address. The second is your origin (myorigin ), which is the domain name from which email appears to originate. This can be the same as your hostname (this will probably be the case for small sites). However, if it is not, be sure to specify the correct hostname. For example, here are the settings for a computer named ip192-168-0-1.ri.ri.cox.net with all email originating from that machine appearing to come from username@cox.net:

myhostname ...

Get Mac OS X Panther for Unix Geeks, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.