Try to starttls if it seems to be the only

way to authenticate a user
This commit is contained in:
Colin Leroy 2003-02-18 10:13:00 +00:00
parent 5a59cbb28d
commit b8ef09e4cc
5 changed files with 22 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2003-02-18 [colin] 0.8.10claws23
* src/common/smtp.[ch]
src/prefs_account.c
Try to starttls if it seems to be the only
way to authenticate a user
2003-02-18 [paul] 0.8.10claws22
* src/Makefile.am

View file

@ -11,7 +11,7 @@ MINOR_VERSION=8
MICRO_VERSION=10
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=claws22
EXTRA_VERSION=claws23
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target

View file

@ -140,11 +140,18 @@ gint smtp_connect(SMTPSession *session, const gchar *server, gushort port,
else
val = smtp_helo(session, domain);
if (val != SM_OK) {
log_warning(_("Error occurred while sending HELO\n"));
log_warning(use_esmtp? _("Error occurred while sending EHLO\n"):
_("Error occurred while sending HELO\n"));
return val;
}
#if USE_OPENSSL
/* if we have a user to authenticate and no auth methods, but starttls,
try to starttls */
if (ssl_type == SSL_NONE && avail_auth_type == SMTPAUTH_TLS_AVAILABLE
&& user != NULL)
ssl_type = SSL_STARTTLS;
if (ssl_type == SSL_STARTTLS) {
val = smtp_starttls(session);
if (val != SM_OK) {
@ -321,6 +328,9 @@ gint smtp_ehlo(SMTPSession *session, const gchar *hostname,
*avail_auth_type |= SMTPAUTH_CRAM_MD5;
if (strcasestr(p, "DIGEST-MD5"))
*avail_auth_type |= SMTPAUTH_DIGEST_MD5;
} else if (g_strncasecmp(p, "STARTTLS", 8) == 0) {
p += 9;
*avail_auth_type |= SMTPAUTH_TLS_AVAILABLE;
}
} else if ((buf[0] == '1' || buf[0] == '2' || buf[0] == '3') &&
(buf[3] == ' ' || buf[3] == '\0'))

View file

@ -51,7 +51,8 @@ typedef enum
{
SMTPAUTH_LOGIN = 1 << 0,
SMTPAUTH_CRAM_MD5 = 1 << 1,
SMTPAUTH_DIGEST_MD5 = 1 << 2
SMTPAUTH_DIGEST_MD5 = 1 << 2,
SMTPAUTH_TLS_AVAILABLE = 1 << 3
} SMTPAuthType;
typedef enum

View file

@ -1794,7 +1794,7 @@ static void prefs_account_ssl_create(void)
CREATE_RADIO_BUTTONS(vbox5,
smtp_nossl_radiobtn,
_("Don't use SSL"),
_("Don't use SSL (or STARTTLS only if necessary)"),
SSL_NONE,
smtp_ssltunnel_radiobtn,
_("Use SSL for SMTP connection"),