+2008-04-30 Peter Maydell <pmaydell@chiark.greenend.org.uk>
+
+ * mts/smtp/smtp.c: provide a callback for SASL_CB_AUTHNAME
+ (fixes issue with SASL sending the wrong username in some
+ circumstances). Thanks to <der_wachtmeister@freenet.de>
+ for the patch.
+
2008-04-29 Peter Maydell <pmaydell@chiark.greenend.org.uk>
* Revert previous attempt at fix for SASL issue as it
#define SM_SASL_N_CB_USER 0
{ SASL_CB_PASS, sm_get_pass, NULL },
#define SM_SASL_N_CB_PASS 1
+ { SASL_CB_AUTHNAME, sm_get_user, NULL },
+#define SM_SASL_N_CB_AUTHNAME 2
{ SASL_CB_LIST_END, NULL, NULL },
};
#endif /* CYRUS_SASL */
user = getusername();
callbacks[SM_SASL_N_CB_USER].context = user;
+ callbacks[SM_SASL_N_CB_AUTHNAME].context = user;
/*
* This is a _bit_ of a hack ... but if the hostname wasn't supplied
{
char *user = (char *) context;
- if (! result || id != SASL_CB_USER)
+ if (! result || ((id != SASL_CB_USER) && (id != SASL_CB_AUTHNAME)))
return SASL_BADPARAM;
*result = user;