http://paulschreiber.com/blog/2011/02/19/howto-set-up-imap-email-for-yahoo/
Cutting to the chase
IMAP server: apple.imap.mail.yahoo.com (username = Yahoo ID)
SMTP server: apple.smtp.mail.yahoo.com (username =
yahooid@yahoo.com)
SSL enabled. Authentication = password.
Step-by-step guide to configuring Mac OS X Mail for Yahoo
Go to Mail > Preferences…
Click Accounts (toolbar)
Click + (lower left)
You’ll see the first pane of the wizard. Enter your email address and password. Then click Continue.
Mail recognizes this as a Yahoo account. But you’re not a paying Yahoo Mail Plus customer, and don’t have access to the POP server. Don’t worry. That’s okay. Click Continue anyway.
On the next screen, select IMAP from the popup and enter apple.imap.mail.yahoo.com as the server name.
Note: most of the instructions on the internet tell you to enter imap.apple.mail.yahoo.com. While this also works, you’ll get an SSL error:
since Yahoo’s wildcard certificate is for *.imap.mail.yahoo.com. If you do this, you have to click Show Certificate, check the “Always trust…” checkbox, click connect and enter your Mac OS username and password.
Why bother?
Next, enter apple.smtp.mail.yahoo.com as your SMTP server. Enter your username (full yahoo email address) and password and click Continue:
The good news: Mail has recognized this as not just an IMAP account, but a Yahoo IMAP account.
The bad news: it thinks it’s a POP account, and has set the port to 995.
Change the port to 993.