Earlier this year I found out that courier-imapd with evolution was
unusable in my setup. I finally nailed it to:
- The messages in the maildir used CRLF as line ending
- evolution uses the RFC822.HEADERS command
- courier imapd RFC822.HEADERS were broken, returning the full message
in such situation

Other MUAs instead used the BODY command, and thus weren't so affected
(the email lines were returned ending in \r\r\n but that's less
problematic).

The maildir specification doesn't any provision for the line ending of
the stored files, nor did courier server document any limitation
(although the code was clearly expecting them only have \n at eol). I
consider that imapd should be able to correctly process those files.

I am following this mail with two patches: the first one fixes
RFC822.HEADER, which is autocontained inside rfc822header(). The second
one fixes the rest of fetch methods, to not prepend a \r to \n if it's
already preceded by \r.
In doing so I added rfc2045_mimepos_flags() as a new variant of
rfc2045_mimepos() taking a flags parameter. If breaking the API is not
an issue, rfc2045_mimepos() itself can be modified (changing the
remaining users).

NB: If you have build objects in your tree, you may need to issue a make
clean. For some reason, I found that when modifying fetch.c make(1)
appeared to correctly recompile the right files, but the server didn't
use the new code (I didn't pursue it, perhaps fetch.o was also included
inside a library not recompiled).

The attached crlfmailsbug.sh can be used to verify this bug. It should
finish with exit code 0 and no output other than the INFO: LOGIN / INFO:
LOGOUT issued by courier (after applying the fixes, of course).

Kind regards

Attachment: crlfmailsbug.sh
Description: application/shellscript

* PREAUTH Ready.
* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\Draft \Answered \Flagged \Deleted \Seen)] Limited
* 1 EXISTS
* 1 RECENT
* OK [UIDVALIDITY 999999] Ok
* OK [MYRIGHTS "acdilrsw"] ACL
A1 OK [READ-WRITE] Ok
* 1 FETCH (RFC822.HEADER {74}
Date: Sat, 20 Jan 2001 20:01:20 +0100
Subject: This is a test message

)
A2 OK FETCH completed.
* BYE Courier-IMAP server shutting down
A3 OK LOGOUT completed
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to