SMTP AUTH explained: PLAIN, LOGIN, and what a 535 actually means
A protocol-level walk through SMTP authentication — the EHLO handshake, STARTTLS, the PLAIN and LOGIN mechanisms byte for byte, and how to read the reply codes when a login fails — with transcripts you can reproduce with openssl and swaks.