You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Yosemite Server fetch mails

Hi


Trying to setup me old E-Mail server environment, but I could not find fetchmail. Is this still available on Yosemite server. If not how can I fetch mails then from my Mailspace and route to a Users. Any help would be highly appreciated. I`m really struggling with that topic.


Cheers

Mac mini, OS X Server, Yosemite

Posted on Nov 21, 2014 3:29 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 22, 2014 5:04 PM

fetchmail ceased to be bundled with server a while ago (it was last bundled with Lion), but it still works.


You'll need Xcode installed in order to do the next step, since we are compelling from source.


  1. Download fetchmail sources from: http://sourceforge.net/projects/fetchmail/
  2. unzip it to the destination you want.
  3. cd to the appropriate directory
  4. type: ./configure ENTER
  5. type: make ENTER
  6. type: sudo make install ENTER


I've got it in /usr/local (bin/ and etc/) so on my setup, fetchmail is run from launchd with the command /usr/local/bin/fetchmail -f /usr/local/etc/fetchmailrc and set to re-launch if the path /usr/local/etc/fetchmailrc changes.


/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>Label</key> <string>local.fetchmail</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/fetchmail</string> <string>-f</string> <string>/usr/local/etc/fetchmailrc</string> </array> <key>RunAtLoad</key> <true/> <key>StartInterval</key> <integer>120</integer> <key>WatchPaths</key> <array> <string>/usr/local/etc/fetchmailrc</string> </array> <key>StandardOutPath</key> <string>/var/log/fetchmail.stdout</string> <key>StandardErrorPath</key> <string>/var/log/fetchmail.stderr</string> <key>ProcessType</key> <string>Background</key> </dict> </plist>


Get the SSL fingerprints for the appropriate servers, with

openssl s_client -connect pop.mail.yahoo.com:995 -showcerts | openssl x509 -fingerprint -noout -md5

And fetchmailrc looks like:

/usr/local/etc/fetchmailrc

# set syslog # sendmail is not running. Need to deliver to Dovecot, on LMTP # Dovecot users are just "x", not "x@localhost", so the usernames all need to be specified # using smtpname, which explicitly sets the whole name (so if you don't include '@' it doesn't # put it in for you---which is what we need here). # # # Yahoo poll Yahoo proto pop3 auth password via pop.mail.yahoo.com user "USERNAME" pass "PASSWORD" smtpname localusername ssl sslfingerprint '11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00' smtp /var/run/dovecot/lmtp
11 replies
Question marked as Top-ranking reply

Nov 22, 2014 5:04 PM in response to Galler

fetchmail ceased to be bundled with server a while ago (it was last bundled with Lion), but it still works.


You'll need Xcode installed in order to do the next step, since we are compelling from source.


  1. Download fetchmail sources from: http://sourceforge.net/projects/fetchmail/
  2. unzip it to the destination you want.
  3. cd to the appropriate directory
  4. type: ./configure ENTER
  5. type: make ENTER
  6. type: sudo make install ENTER


I've got it in /usr/local (bin/ and etc/) so on my setup, fetchmail is run from launchd with the command /usr/local/bin/fetchmail -f /usr/local/etc/fetchmailrc and set to re-launch if the path /usr/local/etc/fetchmailrc changes.


/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>Label</key> <string>local.fetchmail</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/fetchmail</string> <string>-f</string> <string>/usr/local/etc/fetchmailrc</string> </array> <key>RunAtLoad</key> <true/> <key>StartInterval</key> <integer>120</integer> <key>WatchPaths</key> <array> <string>/usr/local/etc/fetchmailrc</string> </array> <key>StandardOutPath</key> <string>/var/log/fetchmail.stdout</string> <key>StandardErrorPath</key> <string>/var/log/fetchmail.stderr</string> <key>ProcessType</key> <string>Background</key> </dict> </plist>


Get the SSL fingerprints for the appropriate servers, with

openssl s_client -connect pop.mail.yahoo.com:995 -showcerts | openssl x509 -fingerprint -noout -md5

And fetchmailrc looks like:

/usr/local/etc/fetchmailrc

# set syslog # sendmail is not running. Need to deliver to Dovecot, on LMTP # Dovecot users are just "x", not "x@localhost", so the usernames all need to be specified # using smtpname, which explicitly sets the whole name (so if you don't include '@' it doesn't # put it in for you---which is what we need here). # # # Yahoo poll Yahoo proto pop3 auth password via pop.mail.yahoo.com user "USERNAME" pass "PASSWORD" smtpname localusername ssl sslfingerprint '11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00' smtp /var/run/dovecot/lmtp

Nov 28, 2014 3:24 PM in response to Galler

To use SSL, first the web site needs to support it. Normally, for each provider, you search for POP and IMAP support and look up what they tell you to do (what servers you need to use) to access them


So, for instance, if you are using SSL and POP on pop.example.com, and it says use port 998, then you need to fetch the SSL finger print using


openssl s_client -connect pop.example.com:995 -showcerts | openssl x509 -fingerprint -noout -md5

If you are using SSL and IMAP in map.mail.example.com and it says use port 993, then the command is


openssl s_client -connect map.mail.example.com:993 -showcerts | openssl x509 -fingerprint -noout -md5

Then you need to set up fetchmailrc appropriately.

So, if you were using POP, on Yahoo, and your Yahoo account was ME_YAHOO with password PASSW0RD and you want mail delivered to REAL_ME on the server, it looks something like:

poll Yahoo proto pop3 auth password via pop.mail.yahoo.com user "ME_YAHOO" pass "PASSW0RD" smtpname REAL_ME ssl sslfingerprint '11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00' smtp /var/run/dovecot/lmtp

If you were using IMAP on example.com it might look like

poll Example proto imap via imap.mail.example.com user "ME_YAHOO" pass "PASSW0RD" smtpname REAL_ME sslfingerprint '11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00' smtp /var/run/dovecot/lmtp

You may or may not need the ssl keyword, and the auth password. You need to tune for each server.

Mar 19, 2015 3:53 PM in response to Michael Newbery

Hi Michael,


Nice explanation, thanks !


One point, the plist file gave me an "109: Invalid property list"

After running plutil -lint /Library/LaunchDaemons/local.fetchmail.plist

It pointed out that the part <string>Background</key> gave the error.

Changed it to <string>Background</string> and now it works perfectly on a OSX 10.10 mini server.


Regards,

John

Yosemite Server fetch mails

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.