diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-04-22 08:29:24 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-04-22 08:29:24 +0000 |
commit | 3a80457f96c30ce7f6d1714fdbea6370b02bd00d (patch) | |
tree | 7132cf6cc3f8888a1c1428b28d4dc4a7acd58298 | |
parent | 69b227b2dd137aa2d16d47c19ac5699e304e6ff0 (diff) |
prefer CRAM-MD5 if authentication type is automatic. Don't use LOGIN if CAPABILITY has LOGINDISABLED.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@231 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 6 | ||||
-rw-r--r-- | src/imap.c | 31 |
3 files changed, 37 insertions, 5 deletions
@@ -1,5 +1,10 @@ 2005-04-22 + * src/imap.c: imap_auth(): prefer CRAM-MD5 if authentication type is + automatic. Don't use LOGIN if CAPABILITY has LOGINDISABLED. + +2005-04-22 + * src/folderview.c: folderview_selection_changed(): flush widget to reflect selection change before showing summary. diff --git a/ChangeLog.ja b/ChangeLog.ja index 03569dc6..cd7ffd7b 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,11 @@ 2005-04-22 + * src/imap.c: imap_auth(): 認証方式が自動の場合は CRAM-MD5 を優先して + 使用するようにした。 CAPABILITY に LOGINDISABLED がある場合は + LOGIN を使用しないようにした。 + +2005-04-22 + * src/folderview.c: folderview_selection_changed(): サマリ表示の前に セレクション変更を反映させるためにウィジェットをフラッシュする ようにした。 @@ -490,12 +490,32 @@ static gint imap_greeting(IMAPSession *session) static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass, IMAPAuthType type) { - gint ok; + gboolean nologin; + gint ok = IMAP_AUTHFAIL; - if (type == 0 || type == IMAP_AUTH_LOGIN) - ok = imap_cmd_login(session, user, pass); - else + nologin = imap_has_capability(session, "LOGINDISABLED"); + + switch (type) { + case 0: + if (imap_has_capability(session, "AUTH=CRAM-MD5")) + ok = imap_cmd_authenticate(session, user, pass, type); + else if (nologin) + log_print(_("IMAP4 server disables LOGIN.\n")); + else + ok = imap_cmd_login(session, user, pass); + break; + case IMAP_AUTH_LOGIN: + if (nologin) + log_warning(_("IMAP4 server disables LOGIN.\n")); + else + ok = imap_cmd_login(session, user, pass); + break; + case IMAP_AUTH_CRAM_MD5: ok = imap_cmd_authenticate(session, user, pass, type); + break; + default: + break; + } if (ok == IMAP_SUCCESS) session->authenticated = TRUE; @@ -2990,7 +3010,8 @@ static gint imap_cmd_authenticate(IMAPSession *session, const gchar *user, gchar *response; gchar *response64; - g_return_val_if_fail(type == IMAP_AUTH_CRAM_MD5, IMAP_ERROR); + g_return_val_if_fail((type == 0 || type == IMAP_AUTH_CRAM_MD5), + IMAP_ERROR); auth_type = "CRAM-MD5"; |