Hi!

It turns out this is quite trivial since etpan already supports gssapi.
All that needs to be done is in attached patch. This is not a final
solution, just a proof of concept patch. Please elaborate as you see fit. 
Note that I had to hard code the server name since imap_threaded_login()
does not pass enough information to login_run(). Also, I did not make any
changes to configuration option - these should obviously be there as well.

The patch will only try GSSAPI if no specific auth method is selected in
Account preferences.

Cheers,
Juha

-- 
                 -----------------------------------------------
                | Juha Jäykkä, [EMAIL PROTECTED]                        |
                | Laboratory of Theoretical Physics             |
                | Department of Physics, University of Turku    |
                | home: http://www.utu.fi/~juolja/              |
                 -----------------------------------------------
--- sylpheed-claws-gtk2-2.4.0/src/imap.c	2006-07-31 10:26:18 +0300
+++ sylpheed-claws-gtk2-2.4.0+gssapi/src/imap.c	2006-08-18 11:57:29 +0300
@@ -602,7 +602,11 @@
 			imap_has_capability(session, "ANONYMOUS"),
 			imap_has_capability(session, "CRAM-MD5"),
 			imap_has_capability(session, "LOGIN"));
+		// added by [EMAIL PROTECTED] on 20060817
+		if (imap_has_capability(session, "GSSAPI"))
+			ok = imap_cmd_login(session, user, pass, "GSSAPI");
+		// end addition
 		if (imap_has_capability(session, "CRAM-MD5"))
 			ok = imap_cmd_login(session, user, pass, "CRAM-MD5");
 		if (ok == IMAP_ERROR) /* we always try LOGIN before giving up */

--- sylpheed-claws-gtk2-2.4.0/src/etpan/imap-thread.c	2006-07-31 10:26:18 +0300
+++ sylpheed-claws-gtk2-2.4.0+gssapi/src/etpan/imap-thread.c	2006-08-18 12:17:48 +0300
@@ -626,11 +626,11 @@
 	if (!strcmp(param->type, "LOGIN"))
 		r = mailimap_login(param->imap,
 			   param->login, param->password);
-	else 
+	else
 		r = mailimap_authenticate(param->imap,
-			param->type, NULL, NULL, NULL,
+			param->type, "hard_coded_server_name", NULL, NULL,
 			param->login, param->login,
-			param->password, NULL);
+			param->password, NULL);	
 #ifdef DISABLE_LOG_DURING_LOGIN
 	mailstream_debug = old_debug;
 #endif

Attachment: signature.asc
Description: PGP signature

Reply via email to