+2 votes

We have two methods that can login to the mail server, one is Login, which on documentation says this method uses LOGIN command for user to login. The other is UseBestLogin, which says will use the best method, when no authentication it will switch to SSL connection.

General questions: What's the basic difference between these two methods? Which one is preferred to be used? Are these choices related to the connection, if the connection is initialized as no-ssl or ssl, will it be different?

Specific questions about UseBestLogin, what is considered as the best method? What are the available login methods besides LOGIN command? If the connection is first set to be ssl, and no auth capacity is found, will it change to no-ssl and retry?

by

1 Answer

+1 vote

You are confusing login methods (e.g. LOGIN, AUTHENTICATE...) with encryption protocols (e.g. SSL, TLS). Those 2 are unrelated.

What's the basic difference between these two methods?

One uses LOGIN command, the other can use LOGIN, AUTHENTICATE PLAIN, CRAM-MD5, DIGEST-MD5, NTLM, NEGOTIATE. Finally it can upgrade the connection to SSL/TLS depending on the server CAPABILITY response.

Which one is preferred to be used?

Imap.UseBestLogin is preferred.

Are these choices related to the connection, if the connection is initialized as no-ssl or ssl, will it be different?
Yes. Server may refuse to use plain text authentication methods on non encrypted connection.

what is considered as the best method?

The one that will most likely work.

If the connection is first set to be ssl, and no auth capacity is found, will it change to no-ssl and retry?

No as connection can not be downgraded to non-SSL/non-TLS.
I don think there are servers configured in such manner.

by (301k points)
...