X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/61ccf1dbeea93978803303d2cd43efa5da2cc7d1..4ea717b986c4b0ce9ccd01687c7b50bd2ab227ca:/mts/smtp/smtp.c?ds=sidebyside diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 08b77498..231bdaef 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -9,7 +9,6 @@ #include #include "smtp.h" #include -#include #include #ifdef CYRUS_SASL @@ -819,7 +818,7 @@ sm_auth_sasl(char *user, int saslssf, char *mechlist, char *inhost) sasl_security_properties_t secprops; sasl_ssf_t *ssf; int *outbufmax; - char *pass = NULL; + struct nmh_creds creds = { 0, 0, 0 }; /* * Initialize the callback contexts @@ -858,9 +857,11 @@ sm_auth_sasl(char *user, int saslssf, char *mechlist, char *inhost) callbacks[SM_SASL_N_CB_USER].context = user; callbacks[SM_SASL_N_CB_AUTHNAME].context = user; + nmh_get_credentials (host, user, 1, &creds); + sasl_pw_context[0] = host; - sasl_pw_context[1] = user; - sasl_pw_context[2] = pass; + sasl_pw_context[1] = creds.user; + sasl_pw_context[2] = creds.password; callbacks[SM_SASL_N_CB_PASS].context = sasl_pw_context; @@ -961,7 +962,6 @@ sm_auth_sasl(char *user, int saslssf, char *mechlist, char *inhost) } else { result = sasl_decode64(sm_reply.text, sm_reply.length, outbuf, sizeof(outbuf), &outlen); - if (result != SASL_OK) { smtalk(SM_AUTH, "*"); sm_ierror("SASL base64 decode failed: %s",