--- protocols/jabber/jabber.c.orig	2011-11-28 13:59:32.459370883 -0800
+++ protocols/jabber/jabber.c	2011-11-28 14:00:20.245552794 -0800
@@ -86,6 +86,9 @@
 	s = set_add( &acc->set, "xmlconsole", "false", set_eval_bool, acc );
 	s->flags |= ACC_SET_OFFLINE_ONLY;
 	
+	s = set_add( &acc->set, "ignore_broken_sasl_digest_md5", "false", set_eval_bool, acc );
+	s->flags |= ACC_SET_OFFLINE_ONLY;
+
 	acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE;
 }
 
--- protocols/jabber/sasl.c.orig	2011-06-12 04:53:51.000000000 -0700
+++ protocols/jabber/sasl.c	2011-11-28 14:01:06.891821215 -0800
@@ -62,6 +62,20 @@
 		c = c->next;
 	}
 	
+	/* Workaround broken servers that advertise DIGEST-MD5 but can't do it;
+	 * most notably in Java-based servers such as OpenFire? when DIGEST-MD5
+	 * is enabled. This appears to be the result of a bug in the Java SASL 
+	 * library.
+	 *
+	 * Newer OpenFire servers have a workaround, but older ones don't.
+	 *
+	 * See http://developer.pidgin.im/ticket/2095
+	 */ 
+	if ( set_getbool( &ic->acc->set, "ignore_broken_sasl_digest_md5" ) )
+	{
+		sup_digest = 0;
+	}
+
 	if( !sup_plain && !sup_digest )
 	{
 		imcb_error( ic, "No known SASL authentication schemes supported" );
