GNOME Bugzilla – Bug 220553
Unable to login into certain IMAP servers
Last modified: 2005-11-15 02:22:21 UTC
Description of Problem: Attempt to access IMAP server at imap.buffalo.edu leads to the persistent login failure error. Here is the transcript of communication between Evolution and IMAP server: received: * OK mail3.acsu.buffalo.edu Cyrus IMAP4 v2.0.16 server ready sending : B00000 CAPABILITY received: * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT MULTIAPPEND SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES IDLE X-NETSCAPE received: B00000 OK Completed sending : ------ LOGIN {N+} .... received: B00001 NO Login failure sending : ------ LOGIN {N+} .... received: sorokine BAD Please login first Here is the explanation of the server behavior from Mark Ferguson <ferguson@buffalo.edu>, help desk manager: This is a Central E-Mail System specific problem, you won't find people on mailing lists reporting this error. Ximian's Evolution IMAP client won't work at the present time. It won't work due to a mishandling of string literals used in by Ximian in the login phase. You can read more about string literals in IMAP in the IMAP rfc RFC2060 Essentialy, Ximian (and for a short time the IMAP client distributed in OS X) ALWAYS uses the string literal format to pass username and password to the server. Normally it isn't neccessary to use string literal notation (the {N+} stuff) which really only must be used when certain strange characters have to be passed. Most IMAP clients (mulberry, netscape, pine, etc) don't bother to use the string literal format unless they really, really have to. The Ximian folks decided to just use it all the time for LOGIN, needed or not. This issue is a known problem with the Central E-Mail System which employs a home-made proxy system for the authentication step when logging in to imap.buffalo.edu and pop.buffalo.edu . There are 4 mail servers in the Central E-Mail System. The proxy system stands in front of those servers and allow you to only have to connect to a single service name and the proxy figures out which mail server your account is really on, and after the authentication step your connection is silently passed to that appropriate mail server). Basically... since not many clients explicitly use String Literals for LOGIN we didn't notice that our proxy code was mishandling String Literals until very recently when a version of MacOS-X's IMAP client started doing the same thing that Ximian is doing. Eventually I believe that was resolved when the developers at Mac contacted us and I _think_ they stopped explicitly using String Literals for LOGIN in their next release. My workstation is RH-linux, and I happend to find a few months ago that Evolution was also using String Literals for LOGIN. Thus far Evolution is the only client I know of which still does this. In the end.. our proxy code (which only handles things like CAPABILITY and LOGIN and then passes your connection to the _real_ Cyrus 2.0.16 server) needs to get fixed. As %99.44 of all IMAP clients don't use String Literals for LOGIN the current priority of the project to fix this aspect of our proxy code is kinda low... so don't expect it to work anytime in the near future unless Evolution changes it's LOGIN behavior [:(] more comments from the bug submitter: I understand that is likely to be a problem related to the particular server but given that imap.buffalo.edu is the central mail service for the State University of New York at Buffalo that serves about 40,000 people fixing it on the Evolution side may be worthwhile.
someone has a patch for this. The problem is the server says it supports LITERAL+ and then doesn't i.e. -> broken server.
Created attachment 41087 [details] [review] Patch to fix Evolution logging into some IMAP servers because of quoted strings.
The above patch does exactly what the bug description recommends Evolution do. It makes Evolution only quote strings when strictly necessary to make the server understand its all one string (ie. only quote strings with special characters, or a space in them). Otherwise any string will remain unquoted. This fixes the problem of logging in, as mentioned above - however if any of the special characters (eg. space, '{', etc) are in the login ID or password, it will still be quoted, so it may still not work. However in most instances, this will fix the problem. Zed is right, the server is broken, and if it says it can accept LITERAL+, it should accept it everywhere, not just after login (the server DOES actually accept LITERAL+, but not for login aparently). However leaving it unresolved because the server is quirky is not the right answer. So here is the patch that makes evolution work around the problem the same was as the other mail clients.
*** bug 222781 has been marked as a duplicate of this bug. ***
I am attempting to build an RPM of evolution with the patch applied for the benefit of the folks here at the University at Buffalo, but I am having a heck of a time. This is what I did: I downloaded the diff at: http://bugzilla.gnome.org/attachment.cgi?id=41087 to /usr/local/src/evolution_1.0.2_literal_fix.diff I downloaded: ftp://ftp.ximian.com/pub/ximian-source/redhat-71-i386/evolution-1.0.3-ximian.4.src.rpm to /usr/local/src. Then I did: rpm -Uvh /usr/local/src/evolution-1.0.3-ximian.4.src.rpm Maybe this was stupid, but I did this and it seemed to work: I copied /usr/local/src/evolution_1.0.2_literal_fix.diff to /usr/local/src/evolution_1.0.3_literal_fix.diff I edited /usr/local/src/evolution_1.0.3_literal_fix.diff file so that I replaced the string "evolution-1.0.2" with "evolution-1.0.3". Then I patched the source while in the /usr/src/redhat/BUILD directory: patch -p0 < /usr/local/src/evolution_1.0.3_literal_fix.diff patching file evolution-1.0.3/camel/providers/imap/camel-imap-command.c patching file evolution-1.0.3/camel/providers/imap/camel-imap-utils.c patching file evolution-1.0.3/camel/providers/imap/camel-imap-utils.h Then I tried: rpm -bc usr/src/redhat/SPEC/evolution.spec It ran for a while, but then I got the following error: configure: error: ---begin--- You need gnome-libs 1.2.9 or higher to build Evolution If you think you already have this installed, consult the README. error: Bad exit status from /var/tmp/rpm-tmp.97569 (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.97569 (%build) Exit 1 ---end--- So then I decided to check my gnome-libs: rpm -q gnome-libs gnome-libs-1.4.1.4-1.ximian.3 I read the README in the BUILD directory, but nothing jumped out at me. What's wrong?
the patch is wrong, btw. It will only fix it in the cases where the password doesn't need to be escaped, otherwise it will still fail. you should really just fix your server.
We understand that. As stated in the first post to this bug and in bug#222781, just about all other IMAP clients do not escape the password when not necessary. The University at Buffalo's support staff handles this by basically informing users that they should not use certain characters in their passwords. We have to do this anyhow since we use a single login for many different services, some of which cannot handle these characters either. For this reason and others (mostly political) that I would rather not get into, fixing the mail server is a very low priority for the department responsible for it. It will probably not get fixed. As I stated in bug#222781, I realize that this is really not your bug, its ours. However, we are a university with 40,000 active users. According to a survey of students located at: http://wings.buffalo.edu/computing/cit-directions/survey/output-3-5-02.html 5.1% of students are using Linux or some BSD variant. (~2000 users) I work in the User Services group of the central IT department for the university. This past year I worked with our engineering school's IT department to create a Red Hat based Linux distribution for the campus. http://wings.buffalo.edu/computing/documentation/linux/catalog.shtml I helped found a campus-wide open source users' group on campus. http://wings.buffalo.edu/org/opensource/ All of these efforts to make Linux and open source software more common on campus have met some resistance at the top levels of the university, mostly because many people regard Linux/UNIX as a user-unfreindly OS. I recently got the OK to work on a pilot program to add x86 Linux support via our "Tech Tools CD". http://www.buffalo.edu/iconnect/ Basically, we will be providing some Linux documentation and some software on the CD. I really think that Evolution and the Ximian desktop are the "killer app" that can get Linux into the mainstream desktop, especially at such a large research institution such as ours. I think that if we are successful with this, I might be able to get my superiors to talk to you in regards to a campus license for next year's Tech Tools CD. I really appreciate all the effort that you have put into the development of Evolution and the Ximian Desktop. I also appreciate you providing us with the patch to get it to work with our mail server. All I am asking for right now is a little help applying this patch. I think if we can get Evolution working with our mail server, we will be much better able to provide Linux as an alternate OS on the desktop for our campus. Thanks again for your time and attention to this matter.
It would surely be easier to fix your proxy than *every* possible client? Probably easier to write a proxy proxy even. I'm a little loathe to change this, because it is as you state, a policitcal issue, which is really not our problem, and one campus is still only 1 campus. And - you do have the source and can mantain your own patch anyway. But - well i'll look into putting some variation of this patch in at some point in the not too distant future.
I think we might both be misunderstanding each other. My understanding is that the the patch given above will not work in all situations. It will not escape the password when the password contains characters that should be escaped. It seems to me however, that it will work in every situation that the other mail clients work with our proxy code. I just want to apply the patch that you have already provided, and I'm having difficulty getting evolution to build after it is applied. When you say that the patch won't work, are you actually saying that evolution just will not build if it is applied, or are you just saying what I stated earlier regarding the escaping of characters in passwords? I'm no longer asking you to change your code. As far as I'm concerned, I can understand why you dont want to make such a change for one poorly-coded mail system. I just want to try to build a version with the patch that you have already provided, or obtain a version with the patch applied, if that is possible. If I can get a version of evolution that will work with our goofy mail-proxy and show it to some people around here so that they can see that there is an app for Linux that is "as good as MS-Outlook", I will be better able to get the people responsible for the mail server to fix the proxy code. I apologize for being such a pain.
Your comment is too hard to read because it isn't wrapped. Anyway, its got nothing to do with your special case. If the patch isn't correct, it isn't correct, even if it will work for you; thats not the issue, I think there was a question that it wouldn't work in *some* cases, and break the imap spec in the process. That was the problem with it. We *will* write a similar patch and put it into the development tree, we just haven't got to it yet. And of course, you are free to build evolution with whatever patches you wish.
My apologies, the patch looks fine, apart from some minor formatting. I'll put it in in the 1.1.x branch this afternoon. Sorry it took so long to get in.
I've checked this into the 1.1.x branch. I changed needs_quoting to is_atom, and fixed the atom decoding table (it . Also fixed the debug logging so that login's aren't printed out when they are used in this form.