2006-04-20 [colin] 2.1.1cvs20
authorColin Leroy <colin@colino.net>
Thu, 20 Apr 2006 16:46:33 +0000 (16:46 +0000)
committerColin Leroy <colin@colino.net>
Thu, 20 Apr 2006 16:46:33 +0000 (16:46 +0000)
* src/imap.c
* src/imap.h
* src/prefs_account.c
Add ANONYMOUS auth for IMAP

ChangeLog
PATCHSETS
configure.ac
src/imap.c
src/imap.h
src/prefs_account.c

index 09c990a62e4698ca93156e9be290cd8bc57853d1..4b057109f20ae0c104826410f36a6798c4dadb70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-20 [colin]     2.1.1cvs20
+
+       * src/imap.c
+       * src/imap.h
+       * src/prefs_account.c
+               Add ANONYMOUS auth for IMAP
+
 2006-04-20 [paul]      2.1.1cvs19
 
        * src/main.c
index 8562e7ff235423894f6c0a374662200fa0d1c1aa..59579a709537338caf1af5995e858b94f20f39d7 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.40 -r 1.1.2.41 src/gtk/quicksearch.c;  ) > 2.1.1cvs17.patchset
 ( cvs diff -u -r 1.115.2.80 -r 1.115.2.81 src/main.c;  ) > 2.1.1cvs18.patchset
 ( cvs diff -u -r 1.115.2.81 -r 1.115.2.82 src/main.c;  ) > 2.1.1cvs19.patchset
+( cvs diff -u -r 1.179.2.106 -r 1.179.2.107 src/imap.c;  cvs diff -u -r 1.34.2.4 -r 1.34.2.5 src/imap.h;  cvs diff -u -r 1.105.2.53 -r 1.105.2.54 src/prefs_account.c;  ) > 2.1.1cvs20.patchset
index ab328536fa7db1a6ffea16007b80b1ca6a238936..dbab2f813be81c47978d274d7a85859580c4cb38 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=1
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=19
+EXTRA_VERSION=20
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index ceddc3e67a53ff251e8e5323454cf91862d48f08..3dc6b35cca08480fd0aff224160213b32d5859d5 100644 (file)
@@ -591,6 +591,9 @@ static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass
        imap_get_capabilities(session);
 
        switch(type) {
+       case IMAP_AUTH_ANON:
+               ok = imap_cmd_login(session, user, pass, "ANONYMOUS");
+               break;
        case IMAP_AUTH_CRAM_MD5:
                ok = imap_cmd_login(session, user, pass, "CRAM-MD5");
                break;
@@ -599,8 +602,10 @@ static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass
                break;
        default:
                debug_print("capabilities:\n"
+                               "\t ANONYMOUS %d\n"
                                "\t CRAM-MD5 %d\n"
                                "\t LOGIN %d\n", 
+                       imap_has_capability(session, "ANONYMOUS"),
                        imap_has_capability(session, "CRAM-MD5"),
                        imap_has_capability(session, "LOGIN"));
                if (imap_has_capability(session, "CRAM-MD5"))
@@ -870,13 +875,15 @@ static void imap_session_authenticate(IMAPSession *session,
        g_return_if_fail(account->userid != NULL);
 
        pass = account->passwd;
-       if (!pass) {
+       if (!pass && account->imap_auth_type != IMAP_AUTH_ANON) {
                gchar *tmp_pass;
                tmp_pass = input_dialog_query_password(account->recv_server, account->userid);
                if (!tmp_pass)
                        return;
                Xstrdup_a(pass, tmp_pass, {g_free(tmp_pass); return;});
                g_free(tmp_pass);
+       } else if (account->imap_auth_type == IMAP_AUTH_ANON) {
+               pass = "";
        }
        statusbar_print_all(_("Connecting to IMAP4 server %s...\n"),
                                account->recv_server);
index 15b9d8912dfa72208d158deb9742397c94649bc1..c9b3221a313ad98fe0e6883c2cd61bd4144fa102 100644 (file)
@@ -25,7 +25,8 @@
 typedef enum
 {
        IMAP_AUTH_LOGIN         = 1 << 0,
-       IMAP_AUTH_CRAM_MD5      = 1 << 1
+       IMAP_AUTH_CRAM_MD5      = 1 << 1,
+       IMAP_AUTH_ANON          = 1 << 2
 } IMAPAuthType;
 
 FolderClass *imap_get_class            (void);
index 66f18fbb2310c31bfb449fadc066d5ccb2a052dc..db38949db016e7604e31a504e4d15fa94daf02fc 100644 (file)
@@ -1595,6 +1595,7 @@ static void prefs_account_receive_create(void)
        MENUITEM_ADD (optmenu_menu, menuitem, _("Automatic"), 0);
        MENUITEM_ADD (optmenu_menu, menuitem, "LOGIN", IMAP_AUTH_LOGIN);
        MENUITEM_ADD (optmenu_menu, menuitem, "CRAM-MD5", IMAP_AUTH_CRAM_MD5);
+       MENUITEM_ADD (optmenu_menu, menuitem, "ANONYMOUS", IMAP_AUTH_ANON);
 
        gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
 
@@ -2726,6 +2727,9 @@ static void prefs_account_imap_auth_type_set_optmenu(PrefParam *pparam)
        case IMAP_AUTH_CRAM_MD5:
                gtk_option_menu_set_history(optmenu, 2);
                break;
+       case IMAP_AUTH_ANON:
+               gtk_option_menu_set_history(optmenu, 3);
+               break;
        case 0:
        default:
                gtk_option_menu_set_history(optmenu, 0);