This imap password loop with yahoo and Apple Mail on my Macbook Pro just started for me in July, about a week ago. It is the only device from which I regularly download my sbcglobal.net mail.
I just got off the phone with 2nd level ATT support and he reconfigured my account in Apple Mail (and did not charge me). My mac was defaulting to imap.mail.yahoo.com because of something it found at att when it checked servers, based on my sbcglobal domain. The tech support person said "We don't support imap." Later he said only in special cases. It took 3 account creation attempts before Apple Mail put up an option for POP.
Below I included what he used for POP and everything is working. (I don't need imap, fortunately. Maybe AT&T has been in a process of slowly prohibiting imap for everything, unless you have "Plus Yahoo", geared toward phones. My guess is that my account just came under that umbrella, as I have been successfully seeing my Yahoo spam folder in Apple Mail for some time now. I'll miss that, but at least I won't be driven crazy by password rejects.)
POP account:
inbound.att.net (used to be imap.mail.yahoo.com) Default port 995.
outbound.att.net (used to be smtp.mail.yahoo.com)
Again, you might need to re-create the account multiple times before your Mac stops defaulting to imap. (Changing it to pop from imap after the fact does not work.)
I hope this helps other "victims" of AT&T's disorganization. As many of us know, that company has deep-rooted, severe problems. Tier 1 tech support said tier 2 would charge me to deal with Apple Mail, thus my search in the communities for a solution before calling again.