CVS: sylpheed-claws/src imap.c,1.179.2.106,1.179.2.107 imap.h,1.34.2.4,1.34.2.5 prefs_account.c,1.105.2.53,1.105.2.54

Colin Leroy <[email protected]>
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /cvsroot/sylpheed-claws/sylpheed-claws/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5698/src

Modified Files:
      Tag: gtk2
	imap.c imap.h prefs_account.c 
Log Message:
2006-04-20 [colin]	2.1.1cvs20

	* src/imap.c
	* src/imap.h
	* src/prefs_account.c
		Add ANONYMOUS auth for IMAP

Index: imap.c
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/imap.c,v
retrieving revision 1.179.2.106
retrieving revision 1.179.2.107
diff -u -r1.179.2.106 -r1.179.2.107
--- imap.c	18 Apr 2006 16:21:10 -0000	1.179.2.106
+++ imap.c	20 Apr 2006 16:46:32 -0000	1.179.2.107
@@ -591,6 +591,9 @@
 	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 @@
 		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 @@
 	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: imap.h
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/imap.h,v
retrieving revision 1.34.2.4
retrieving revision 1.34.2.5
diff -u -r1.34.2.4 -r1.34.2.5
--- imap.h	13 Jan 2006 17:24:11 -0000	1.34.2.4
+++ imap.h	20 Apr 2006 16:46:32 -0000	1.34.2.5
@@ -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: prefs_account.c
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/prefs_account.c,v
retrieving revision 1.105.2.53
retrieving revision 1.105.2.54
diff -u -r1.105.2.53 -r1.105.2.54
--- prefs_account.c	18 Apr 2006 16:21:10 -0000	1.105.2.53
+++ prefs_account.c	20 Apr 2006 16:46:32 -0000	1.105.2.54
@@ -1595,6 +1595,7 @@
 	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 @@
 	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);



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.