You managed to get yahoo working with imap. I've been trying to do that
without success.
And got gmail and yahoo working with imap, at least for reading. I had
to set up application passwords for both as I have second factor
authentication.
What imap and smtp codes did you use? From what I can gather yahoo has imap
codes for reading mail on mobile phone apps but not PC email.
Notice that this is gnus, not rmail.
I am not sure what you mean by codes.
I also have a .auth file. I have this in .gnus:
(setq user-full-name "????????")
(setq user-mail-address "????????@yahoo.co.uk")
(setq rmail-preserve-inbox t)
(setq gnus-select-method '(nnimap "gmail"
(nnimap-address "imap.gmail.com")
(nnimap-server-port 993)
(nnimap-stream ssl)))
(add-to-list 'gnus-secondary-select-methods '(nnimap "yahoo"
(nnimap-address "imap.mail.yahoo.com")
(nnimap-server-port 993)
(nnimap-stream ssl)))
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-starttls-credentials '(("smtp.mail.yahoo.com" 587 nil nil))
smtpmail-auth-credentials '(("smtp.mail.yahoo.com" 587
"????????@yahoo.co.uk" nil))
smtpmail-default-smtp-server "smtp.mail.yahoo.com"
smtpmail-smtp-server "smtp.mail.yahoo.com"
smtpmail-smtp-service 587)