When I'm doing IMAP authentication of one the public email servers and login is successful I believe, it replies like this:
* CAPABILITY IMAP4rev1 ID XLIST UIDPLUS UNSELECT MOVE LIST-STATUS
OK as you can see, neither a
TAG value. However, according to this
https://tools.ietf.org/html/rfc3501#section-6.2.3 they should be included always.
In case of unsuccesful login, it replies like this:
TAG_2 NO [AUTHENTICATIONFAILED] Authentication failed
which makes sense.