The series continues in Learning the Terminal in Mac OS X, Automating Mail from the Mac OS X Terminal, Configuring Email from the Mac OS X Terminal, Customizing the Mac OS X Terminal, and Synchronizing Drives with Cron and the Mac OS X Terminal.
However, none of the first three parts of the series will work in Mac OS X 10.2 (Jaguar) or newer. Jaguar brought several major changes to the OS that require significant changes to the procedure. I'll be posting Jaguar compatible updates to these articles shortly.
As those of you who've updated to Mac OS X 10.1.5 have discovered, sendmail no longer works as described in Learning the Mac OS X Terminal, Part 3. The 10.1.5 version updates sendmail to 8.12.2 from 8.11, and in the process tightened up security considerably.
In short, what you need to do is generate a new
sendmail.cf file from scratch, using the m4 "macro language processor." You'll also need to change some permissions, as well as configure your system to run the sendmail daemon at startup. (This was not necessary for sending local mail in 10.1.4 and earlier, but apparently is now).
If you are using sendmail primarily to receive job reports locally from Cron, as described in this tutorial, then the following steps will get you going again. If you are using sendmail to do more than that, then this procedure still might work, but I can't guarantee that.
Also, if you've made any prior changes to your
sendmail.cf, you'll need to make them again to the new one you'll generate here. I'll show you how to add the
DontBlameSendmail line again.
You'll find some instructions in
/etc/mail/README, which I paraphrase here:
Copy the default config file to
sudo cp generic-darwin.mc yourdomain.mc
(Itís OK to use the literal "yourdomain" if you don't have a domain for your machine. If you do have a domain, then use it instead.)
If you want to use the
DontBlameSendmail option as described in the tutorial, then you can add it the
mc file here:
sudo pico yourdomain.mc
And add this line to the end of the file:
sendmail.cf file from the
m4 file you just edited:
m4 ../m4/cf.m4 yourdomain.mc > /tmp/sendmail.cf
Back up your old
sudo cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.orig
Put your new
sendmail.cf in place:
sudo cp /tmp/sendmail.cf /etc/mail/
The new version of sendmail is compiled to look at NetInfo for a pointer to its config file, so you'll need to add that record. So, to ensure that sendmail does not read its config file from NetInfo, execute the following commands:
sudo niutil -create . /locations/sendmail sudo niutil -createprop . /locations/sendmail sendmail.cf /etc/mail/sendmail.cf
This will tell sendmail (when it looks at NetInfo) to not look in NetInfo for its config file, but to look at
You'll need to fix the group of the sendmail client queue directory:
sudo chgrp smmsp /var/spool/clientmqueue
If you're not using the
DontBlameSendmail option, then you'll need to turn off group-writablity for the root directory again, since the update turns that back on:
sudo chmod g-w /
To have sendmail launch at system startup, you'll need to make two changes in two files.
sudo pico /etc/hostconfig
Find this line:
And change it to this (NO to YES):
Save that file and then open
sudo pico /System/Library/StartupItems/Sendmail/Sendmail
Find this line near the end:
/usr/sbin/sendmail -bd -q1h
And add this line after it:
/usr/sbin/sendmail -C /etc/mail/submit.cf -q1h
Save that file and restart your machine to allow the startup script to run. You should find that sendmail will work again as it had in 10.1.4. It might turn out that these steps can be simplified further, and I'll keep you posted if that's the case. For now, though, this will at least get you running again.
Chris Stone is a Senior Macintosh Systems Administrator for O'Reilly, coauthor of Mac OS X in a Nutshell and contributing author to Mac OS X: The Missing Manual, which provides over 40 pages about the Mac OS X Terminal.
Return to the MacDevCenter.com.
Copyright © 2009 O'Reilly Media, Inc.