You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Steve (JIRA)" <ji...@apache.org> on 2013/08/19 11:25:48 UTC

[jira] [Created] (PROTOCOLS-106) CRLFTerminatedInputStream does not do what it is supposed to. Missing CR if last char is \n Outlook hangs forever DL messages

Steve created PROTOCOLS-106:
-------------------------------

             Summary: CRLFTerminatedInputStream does not do what it is supposed to. Missing CR if last char is \n Outlook hangs forever DL messages
                 Key: PROTOCOLS-106
                 URL: https://issues.apache.org/jira/browse/PROTOCOLS-106
             Project: James Protocols
          Issue Type: Bug
          Components: pop3
    Affects Versions: 1.6.2
            Reporter: Steve
            Assignee: Eric Charles


A message transfer to a pop3 client is finished when the server issues
CRLF DOT CRLF

However this is not always the case with the current implementation.

The method

 private void calculateExtraData() {
109        if (last == '\n') {
110            extraData = null;
111        } else if (last == '\r') {
112            extraData = new byte[1];
113            extraData[0] = '\n';
114        } else {
115            extraData = new byte[2];
116            extraData[0] = '\r';
117            extraData[1] = '\n';
118        }
119
120    }

Does not factor in when the last byte is "\n" but the one before is NOT "\r" - meaning the resulting output to the client is actually

CRLF DOT LF

Outlook will hang forever because it does not see a termination of the message. (See POP3 RFC - it MUST be CRLF DOT LF - Thunderbird is not as strict tho)

A java MimeMessage is not guaranteed to be canoniclized by CRLF - see http://www.oracle.com/technetwork/java/faq-135477.html#repres

The current workaround is to implement Mailbox and overwrite  public InputStream getMessage(String uid) to always make sure the message stream ends with a CRLF.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org