+2002-04-07 [paul] 0.7.4claws71
+
+ * src/esmtp.[ch]
+ src/smtp.c
+ try to authenticate with CRAM-MD5 in SMTP when
+ SMTP-AUTH enabled even if MTA doesn't issue this
+ auth-method in it's ehlo-response. bug item #531364,
+ patch item #938910. patch submitted by Colin Leroy
+ <colin@colino.net>
+
2002-04-07 [paul] 0.7.4claws70
* src/nntp.c
MICRO_VERSION=4
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws70
+EXTRA_VERSION=claws71
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
gint esmtp_ehlo(SockInfo *sock, const gchar *hostname)
{
+ smtp_auth_methods[0] = smtp_auth_methods[1] = smtp_auth_methods[2] = smtp_auth_methods[3] = FALSE;
sock_printf(sock, "EHLO %s\r\n", hostname);
if (verbose)
log_print("ESMTP> EHLO %s\n", hostname);
if (verbose)
log_print("ESMTP< %s\n", esmtp_response);
+ if (strncasecmp("250-AUTH", esmtp_response, 8) == 0) {
+ smtp_auth_methods[SMTPAUTH_LOGIN] = (strstr(esmtp_response, " LOGIN") != NULL);
+ smtp_auth_methods[SMTPAUTH_CRAM_MD5] = (strstr(esmtp_response, " CRAM-MD5") != NULL);
+ smtp_auth_methods[SMTPAUTH_DIGEST_MD5] = FALSE; /* not implemented yet */
+ }
+
if ((esmtp_response[0] == '1' || esmtp_response[0] == '2' ||
esmtp_response[0] == '3') && esmtp_response[3] == ' ')
return SM_OK;
gint esmtp_auth(SockInfo *sock, SMTPAuthType authtype,
const gchar *userid, const gchar *passwd);
gint esmtp_ok(SockInfo *sock);
+gboolean smtp_auth_methods[4];
#endif /* __ESMTP_H__ */
if (use_smtp_auth) {
/* exist AUTH-Type CRAM_MD5 */
- if (esmtp_auth_cram_md5(sock) == SM_ERROR) {
+ if (!smtp_auth_methods[SMTPAUTH_CRAM_MD5]
+ || esmtp_auth_cram_md5(sock) == SM_ERROR) {
/* exist AUTH-Type LOGIN */
- if (esmtp_auth_login(sock) == SM_ERROR)
+ if (!smtp_auth_methods[SMTPAUTH_LOGIN]
+ || esmtp_auth_login(sock) == SM_ERROR)
return SM_ERROR;
else
authtype = SMTPAUTH_LOGIN;