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
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;
} 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",
X("fileproc", -4, FILEPROCSW) \
X("mhlproc", -3, MHLPROCSW) \
X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \
+ X("credentials legacy|file:filename", 0, CREDENTIALSSW) \
X("messageid localname|random", 2, MESSAGEIDSW) \
#define X(sw, minchars, id) id,
save_mts_method (cp);
continue;
+ case CREDENTIALSSW: {
+ /* post doesn't read the profile, so insert credentials
+ entry the hard way. */
+ struct node *np = (struct node *) mh_xmalloc (sizeof *np);
+
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ np->n_name = "credentials";
+ np->n_field = cp;
+ np->n_context = 0;
+ np->n_next = m_defs;
+ m_defs = np;
+ continue;
+ }
+
case MESSAGEIDSW:
if (!(cp = *argp++) || *cp == '-')
adios (NULL, "missing argument to %s", argp[-2]);
vec[vecp++] = getcpy (m_maildir (""));
if ((cp = context_find ("fileproc"))) {
- vec[vecp++] = "-fileproc";
- vec[vecp++] = cp;
+ vec[vecp++] = "-fileproc";
+ vec[vecp++] = cp;
}
if ((cp = context_find ("mhlproc"))) {
- vec[vecp++] = "-mhlproc";
- vec[vecp++] = cp;
+ vec[vecp++] = "-mhlproc";
+ vec[vecp++] = cp;
+ }
+
+ if ((cp = context_find ("credentials"))) {
+ /* post doesn't read context so need to pass credentials. */
+ vec[vecp++] = "-credentials";
+ vec[vecp++] = cp;
}
while ((cp = *argp++)) {