How can I determine which SASL mechanism was used?

In my code, before creating my TIdIMAP4 connection, I created a whole bunch of SASL mechanisms, in which we hopefully prescribed the "best worst" order as follows:

IMAP.SASLMechanisms.Add.SASL := mIdSASLCRAMSHA1; IMAP.SASLMechanisms.Add.SASL := mIdSASLCRAMMD5; IMAP.SASLMechanisms.Add.SASL := mIdSASLSKey; IMAP.SASLMechanisms.Add.SASL := mIdSASLOTP; IMAP.SASLMechanisms.Add.SASL := mIdSASLAnonymous; IMAP.SASLMechanisms.Add.SASL := mIdSASLExternal; IMAP.SASLMechanisms.Add.SASL := mIdSASLLogin; IMAP.SASLMechanisms.Add.SASL := mIdSASLPlain; 

and I install IMAP.AuthType := iatSASL; , so I think it should be a connection to SASL. But is there any way (say, after establishing a connection) to find out which SASL mechanism he actually used to create the connection?

+4
source share
1 answer

Sorry, there is nothing in Indy to find out which SASLs have been undertaken and / or successful. Indy compares the contents of SASLMechanisms with those reported by the SASL server, builds a list of matches, and then SASLMechanisms over this list, each time trying each SASL until one of them succeeds, then the list will be discarded. The only way to find out which SASL attempts are being made is to control the raw socket traffic, for example, with one of the Indy Intercept components, and manually analyze the IMAP commands that are sent.

+1
source

Source: https://habr.com/ru/post/1494619/


All Articles