fetchmail LaunchDaemon for macosx

by bram

$ vi /Library/LaunchDaemons/local.fetchmail.plist
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>local.fetchmail</string>
<key>Program</key>
<string>/usr/bin/fetchmail</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/fetchmail</string>
<string>–fetchmailrc=/Users/<snip>/.fetchmailrc</string>
<string>–pidfile=/Users/<snip>/.fetchmail.pid</string>
<string>–daemon=1800</string>
<string>–nodetach</string>
</array>
<key>QueueDirectories</key>
<array/>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string><snip></string>
<key>WatchPaths</key>
<array/>
<key>WorkingDirectory</key>
<string>/Users/<snip>/.fetchmail</string>
</dict>
</plist>

$ mkdir /Users/<snip>/.fetchmail

$ sudo launchctl load -w /Library/LaunchDaemons/local.fetchmail.plist

$ tail -f /var/log/system.log