If I understand right it appears that the phone was trying to use IMAP4 when it should have been using POP, plus outgoing server address was incorrect. Then login problem was solved as I was following Yahoo's instruction to drop "@yahoo.com" off username, but in this case doing so was incorrect.