[qmf] Introduce discovery of authentication from the anounced capabilities(IMAP/SMTP)

Yes, in theory it could still fail again and enter a loop, however when I tested server would issue a "530 too many auth requests" after a few tries.