Commit 802150a1 802150a165325d9d7a2824765c32852afc6e7797 by Sergey Poznyakoff

Do not ask for ESMTP credentials if unable to handle them.

* libproto/mailer/smtp.c (smtp_open): Disable ESTMP AUTH if
GSASL support is not compiled.
* libproto/mailer/smtp_auth.c (mu_smtp_auth): If compiled
without GSASL, don't attempt to obtain user credentials.
1 parent d1e34b1a
......@@ -134,6 +134,16 @@ smtp_mailer_add_auth_mech (struct _smtp_mailer *smtp_mailer, const char *str)
}
}
/* FIXME: So far, ESMTP AUTH support is available only if MU is compiled
with GNU SASL. Should this change, the define below must be changed
as well. See also smtp_auth.c.
*/
#ifdef WITH_GSASL
# define DFLNOAUTH 0
#else
# define DFLNOAUTH 1
#endif
static int
smtp_open (mu_mailer_t mailer, int flags)
{
......@@ -144,7 +154,7 @@ smtp_open (mu_mailer_t mailer, int flags)
char **parmv = NULL;
int tls = 0;
int nostarttls = 0;
int noauth = 0;
int noauth = DFLNOAUTH;
rc = mu_url_sget_scheme (mailer->url, &scheme);
if (rc == 0)
......
......@@ -112,6 +112,7 @@ mu_smtp_auth (mu_smtp_t smtp)
if (smtp->state != MU_SMTP_MAIL)
return MU_ERR_SEQ;
#if defined(WITH_GSASL)
/* Obtain missing authentication credentials either from the
URL (when supplied) or from the user ticket file, or by
asking the user, if anything else fails.
......@@ -126,10 +127,11 @@ mu_smtp_auth (mu_smtp_t smtp)
_mu_smtp_fixup_params (smtp);
if (!smtp->param[MU_SMTP_PARAM_USERNAME] && !smtp->secret)
return MU_ERR_AUTH_NO_CRED;
#if defined(WITH_GSASL)
return _mu_smtp_gsasl_auth (smtp);
#else
/* FIXME: Provide support for some basic authentication methods */
/* FIXME: Provide support for some basic authentication methods.
Once done, make sure _mu_smtp_fixup_params is called for this
branc as well (though see the fixme above). */
return ENOSYS;
#endif
}
......