Mail login problems over IPv6
This week the connection to my Yahoo email account stopped working. I have both IPv4 and IPv6 on my home network, which is an unusual setup. I worked out that connections to login.yahoo.com are not working most of the time over IPv6, but are working over IPv4. I was able to add a rule to my local DNS cache server so that it only returns IPv4 addresses for any yahoodns.net address (login.yahoo.com, smtp.mail.yahoo.com and imap.mail.yahoo.com all resolve to yahoodns.net addresses). This has fixed my connection issue.
My suggestion is that it looks like you have a problem with IPv6 connectivity on some of your yahoodns.net machines, which you might like to fix!