10.4: Auto-launch Fetchmail during boot

Jun 28, '05 09:05:00AM

Contributed by: Manevitch

Tiger only hintThe one thing I missed when I switched to 10.4 was Fetchmail -- I use it to pull my email from various places, and it always fired right up when I booted my computer. With the release of 10.4, Apple instituted some under-the-hood changes to the way programs auto-launch at reboot, and it's taken me until now to figure out how to run Fetchmail automatically at boot.

To auto-load Fetchmail at boot, copy the text below and paste it into a file called fetchmail.plist. The plist I use loads .fetchmailrc from /etc/mail; change this if you use a different location. Place the file in /Library/LaunchDaemons. Set permissions to 644, and set the owner to root:wheel.

<?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>GroupName</key>
    <string>wheel</string>
    <key>Label</key>
    <string>fetchmail</string>
    <key>OnDemand</key>
    <false/>
    <key>Program</key>
    <string>/usr/bin/fetchmail</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/fetchmail</string>
        <string>-f</string>
        <string>/etc/mail/.fetchmailrc</string>
        <string>-L</string>
        <string>/var/log/mail.log</string>
        <string>-s</string>
     </array>
     <key>RunAtLoad</key>
     <true/>
     <key>UserName</key>
     <string>root</string>
</dict>
</plist>
[robg adds: I haven't tested this one. Please note that I broke the !DOCTYPE line into two lines, for a narrower display. Enter it as one with a space replacing the line break.]

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050614170802721