Hi,

I'd emailed a long time back about issues using the .NET SmtpClient and AOX.

I've spent a little time digging around since this issue came up for me
again and I have applied a patch which resolved the issue for me and
looks like it may address the problem properly.

In sasl/sasllogin.cpp, the constructor is empty :

/*! Creates a new SaslLogin object on behalf of \a c. */

SaslLogin::SaslLogin( EventHandler * c )
    : SaslMechanism( c, SaslMechanism::Login )
{
}

Which seems pretty odd, when you compare with other methods which have
the constructor setting the state to AwaitingInitialResponse.  e.g.
plain.cpp :

/*! Creates a plain-text SASL authentication object on behalf of \a c */

Plain::Plain( EventHandler *c )
    : SaslMechanism( c, SaslMechanism::Plain )
{
    setState( AwaitingInitialResponse );
}


So, skipping all the debugging and testing I did, I patched the
sasllogin to set the initial state to AwaitingInitialResponse :

/*! Creates a new SaslLogin object on behalf of \a c. */

SaslLogin::SaslLogin( EventHandler * c )
    : SaslMechanism( c, SaslMechanism::Login )
{
    setState( AwaitingInitialResponse );
}

And then it tested and worked OK for me using .NET SmtpClient (and also
SQL-Server mail) when these both previously failed with a user not
authenticated error :

Authentication failed for: ""
Response: 535 5.0.0 Authentication failed


Patch file attached (1 line, hardly required !)

Jim


--- sasllogin.cpp       2014-06-03 13:15:21.000000000 +0000
+++ sasllogin-fixed.cpp 2015-04-07 17:09:26.334959000 +0000
@@ -22,6 +22,7 @@
 SaslLogin::SaslLogin( EventHandler * c )
     : SaslMechanism( c, SaslMechanism::Login )
 {
+    setState( AwaitingInitialResponse );
 }
 

Reply via email to