2006-11-02 [colin] 2.5.6cvs19
authorColin Leroy <colin@colino.net>
Thu, 2 Nov 2006 10:12:22 +0000 (10:12 +0000)
committerColin Leroy <colin@colino.net>
Thu, 2 Nov 2006 10:12:22 +0000 (10:12 +0000)
* src/imap.c
* src/imap.h
* src/prefs_account.c
* src/etpan/imap-thread.c
Add GSSAPI support - fixes Debian bug #383274

ChangeLog
PATCHSETS
configure.ac
src/etpan/imap-thread.c
src/imap.c
src/imap.h
src/prefs_account.c

index d91633efa03237b9357b4a3ee67530a34fb3d555..fc1c57ce6b972ae6c3d9552f324e4c0c1901a821 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-11-02 [colin]     2.5.6cvs19
+
+       * src/imap.c
+       * src/imap.h
+       * src/prefs_account.c
+       * src/etpan/imap-thread.c
+               Add GSSAPI support - fixes Debian bug #383274
+
 2006-11-01 [colin]     2.5.6cvs18
 
        * src/jpilot.c
index 3737b46dd014d163a8ee91269d637d7b689bfca8..17ac4cde2cdc38232a164bc97502e7a4070a61ae 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.5.10.3 -r 1.5.10.4 COPYING;  ) > 2.5.6cvs16.patchset
 ( cvs diff -u -r 1.3.2.12 -r 1.3.2.13 src/folderutils.c;  ) > 2.5.6cvs17.patchset
 ( cvs diff -u -r 1.18.2.16 -r 1.18.2.17 src/jpilot.c;  ) > 2.5.6cvs18.patchset
+( cvs diff -u -r 1.179.2.136 -r 1.179.2.137 src/imap.c;  cvs diff -u -r 1.34.2.7 -r 1.34.2.8 src/imap.h;  cvs diff -u -r 1.105.2.68 -r 1.105.2.69 src/prefs_account.c;  cvs diff -u -r 1.1.4.54 -r 1.1.4.55 src/etpan/imap-thread.c;  ) > 2.5.6cvs19.patchset
index 02b3559a29339d5a1f41751919fc1b276ff634cb..91152e6d6fc4125763ec2b054b2b573449507a94 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=18
+EXTRA_VERSION=19
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index a644de741db8e4959b84916def62fae9f0e6bc7d..99c19197a35e82acefe42faa9cf451a7515cefac 100644 (file)
@@ -643,6 +643,7 @@ struct login_param {
        const char * login;
        const char * password;
        const char * type;
+       const char * server;
 };
 
 struct login_result {
@@ -667,6 +668,11 @@ static void login_run(struct etpan_thread_op * op)
        if (!strcmp(param->type, "LOGIN"))
                r = mailimap_login(param->imap,
                           param->login, param->password);
+       else if (!strcmp(param->type, "GSSAPI"))
+               r = mailimap_authenticate(param->imap,
+                       param->type, param->server, NULL, NULL,
+                       param->login, param->login,
+                       param->password, NULL);
        else 
                r = mailimap_authenticate(param->imap,
                        param->type, NULL, NULL, NULL,
@@ -694,6 +700,10 @@ int imap_threaded_login(Folder * folder,
        param.login = login;
        param.password = password;
        param.type = type;
+       if (folder && folder->account)
+               param.server = folder->account->recv_server;
+       else
+               param.server = NULL;
 
        threaded_run(folder, &param, &result, login_run);
        
index 38fd52fd25a8c6fc9e32d426c1b2aeda33678a5c..edacb29a0d0ad1acb42a9d4054f34f02dafa9e77 100644 (file)
@@ -604,16 +604,23 @@ static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass
        case IMAP_AUTH_LOGIN:
                ok = imap_cmd_login(session, user, pass, "LOGIN");
                break;
+       case IMAP_AUTH_GSSAPI:
+               ok = imap_cmd_login(session, user, pass, "GSSAPI");
+               break;
        default:
                debug_print("capabilities:\n"
                                "\t ANONYMOUS %d\n"
                                "\t CRAM-MD5 %d\n"
-                               "\t LOGIN %d\n", 
+                               "\t LOGIN %d\n"
+                               "\t GSSAPI %d\n", 
                        imap_has_capability(session, "ANONYMOUS"),
                        imap_has_capability(session, "CRAM-MD5"),
-                       imap_has_capability(session, "LOGIN"));
+                       imap_has_capability(session, "LOGIN"),
+                       imap_has_capability(session, "GSSAPI"));
                if (imap_has_capability(session, "CRAM-MD5"))
                        ok = imap_cmd_login(session, user, pass, "CRAM-MD5");
+               if (ok == IMAP_ERROR && imap_has_capability(session, "GSSAPI"))
+                       ok = imap_cmd_login(session, user, pass, "GSSAPI");
                if (ok == IMAP_ERROR) /* we always try LOGIN before giving up */
                        ok = imap_cmd_login(session, user, pass, "LOGIN");
        }
index 9ee7a879ba2a16919d95045cc4b344ac87f5ed55..d64b8ede15a05dd8614f24ede9816adfb8b7048b 100644 (file)
@@ -26,7 +26,8 @@ typedef enum
 {
        IMAP_AUTH_LOGIN         = 1 << 0,
        IMAP_AUTH_CRAM_MD5      = 1 << 1,
-       IMAP_AUTH_ANON          = 1 << 2
+       IMAP_AUTH_ANON          = 1 << 2,
+       IMAP_AUTH_GSSAPI        = 1 << 3
 } IMAPAuthType;
 
 FolderClass *imap_get_class            (void);
index e943a9c35efe94f9e3c064677d4bf1173024113f..3c2721d0d4d8686913fdbdd94fe8d6c8e8135ba6 100644 (file)
@@ -1602,6 +1602,7 @@ static void prefs_account_receive_create(void)
        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);
+       MENUITEM_ADD (optmenu_menu, menuitem, "GSSAPI", IMAP_AUTH_GSSAPI);
 
        gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
 
@@ -2743,6 +2744,9 @@ static void prefs_account_imap_auth_type_set_optmenu(PrefParam *pparam)
        case IMAP_AUTH_ANON:
                gtk_option_menu_set_history(optmenu, 3);
                break;
+       case IMAP_AUTH_GSSAPI:
+               gtk_option_menu_set_history(optmenu, 4);
+               break;
        case 0:
        default:
                gtk_option_menu_set_history(optmenu, 0);