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

You mean the one below ? is partly repeated 3 times since for cram is a bit different, but can go into separated function