-1

Can someone help me translate a line from this code to C++ Builder:

http://blog.onkeysoft.com/2011/04/20/how-to-prepare-a-connection-to-pop3-server-with-indy-tidpop3/

I was doing good until this line:

 POP3Client.SASLMechanisms.Add.SASL := tidsasl(con_sasl_anonymous);

Additional question - is there a "good" order of SASL mechanisms to try out - from most secure to least secure? In other words, what would be a good order of them? I would try with SHA1 first, then MD5 then... something here... and PlainText as last one.

4

1 回答 1

3

For future googlers - thanks to TLama:

TIdSASLListEntry *se = POP3Client->SASLMechanisms->Add();
se->SASL = (TIdSASL*)con_sasl_anonymous;

Or if you prefer C++ style casts:

TIdSASLListEntry *se = POP3Client->SASLMechanisms->Add();
se->SASL = static_cast<TIdSASL*>(con_sasl_anonymous);
于 2013-03-31T01:30:31.200 回答