You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Stefano Bagnara (JIRA)" <ji...@apache.org> on 2008/06/19 19:19:45 UTC

[jira] Created: (GERONIMO-4135) Too many CRLF at the end of the message

Too many CRLF at the end of the message
---------------------------------------

                 Key: GERONIMO-4135
                 URL: https://issues.apache.org/jira/browse/GERONIMO-4135
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: mail
    Affects Versions: 2.1.1
            Reporter: Stefano Bagnara
            Assignee: Rick McGuire


We have a lot of tests trying to send a message to james and reading the result: most of the tests fail because the result contains 2 trailing CRLF more than expected (we send one crlf at the end of the message we receive 3 crlf).

I don't exactly know where does it happen but this does not with sun implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4135) Too many CRLF at the end of the message

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607254#action_12607254 ] 

Stefano Bagnara commented on GERONIMO-4135:
-------------------------------------------

No time now to go deeper in this. I suspect this have something to do with this snippet from rfc2821:
{quote}
   The mail data is terminated by a line containing only a period, that
   is, the character sequence "<CRLF>.<CRLF>" (see section 4.5.2).  This
   is the end of mail data indication.  Note that the first <CRLF> of
   this terminating sequence is also the <CRLF> that ends the final line
   of the data (message text) or, if there was no data, ends the DATA
   command itself.  An extra <CRLF> MUST NOT be added, as that would
   cause an empty line to be added to the message.  The only exception
   to this rule would arise if the message body were passed to the
   originating SMTP-sender with a final "line" that did not end in
   <CRLF>; in that case, the originating SMTP system MUST either reject
   the message as invalid or add <CRLF> in order to have the receiving
   SMTP server recognize the "end of data" condition.
{quote}

> Too many CRLF at the end of the message
> ---------------------------------------
>
>                 Key: GERONIMO-4135
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4135
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.1.1
>            Reporter: Stefano Bagnara
>            Assignee: Rick McGuire
>
> We have a lot of tests trying to send a message to james and reading the result: most of the tests fail because the result contains 2 trailing CRLF more than expected (we send one crlf at the end of the message we receive 3 crlf).
> I don't exactly know where does it happen but this does not with sun implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (GERONIMO-4135) Too many CRLF at the end of the message

Posted by "Rick McGuire (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick McGuire closed GERONIMO-4135.
----------------------------------


> Too many CRLF at the end of the message
> ---------------------------------------
>
>                 Key: GERONIMO-4135
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4135
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.1.1
>            Reporter: Stefano Bagnara
>            Assignee: Rick McGuire
>
> We have a lot of tests trying to send a message to james and reading the result: most of the tests fail because the result contains 2 trailing CRLF more than expected (we send one crlf at the end of the message we receive 3 crlf).
> I don't exactly know where does it happen but this does not with sun implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (GERONIMO-4135) Too many CRLF at the end of the message

Posted by "Rick McGuire (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick McGuire resolved GERONIMO-4135.
------------------------------------

    Resolution: Fixed

Committed revision 670717.

It was a problem with not recognizing that the data had terminated with a CRLF already before writing the end-of-data marker. 

> Too many CRLF at the end of the message
> ---------------------------------------
>
>                 Key: GERONIMO-4135
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4135
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.1.1
>            Reporter: Stefano Bagnara
>            Assignee: Rick McGuire
>
> We have a lot of tests trying to send a message to james and reading the result: most of the tests fail because the result contains 2 trailing CRLF more than expected (we send one crlf at the end of the message we receive 3 crlf).
> I don't exactly know where does it happen but this does not with sun implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4135) Too many CRLF at the end of the message

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607572#action_12607572 ] 

Stefano Bagnara commented on GERONIMO-4135:
-------------------------------------------

I confirm that tests currently pass! Great, Thank you!

> Too many CRLF at the end of the message
> ---------------------------------------
>
>                 Key: GERONIMO-4135
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4135
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.1.1
>            Reporter: Stefano Bagnara
>            Assignee: Rick McGuire
>
> We have a lot of tests trying to send a message to james and reading the result: most of the tests fail because the result contains 2 trailing CRLF more than expected (we send one crlf at the end of the message we receive 3 crlf).
> I don't exactly know where does it happen but this does not with sun implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4135) Too many CRLF at the end of the message

Posted by "Rick McGuire (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12606772#action_12606772 ] 

Rick McGuire commented on GERONIMO-4135:
----------------------------------------

How is the send/receive being accomplished?  Are you using SMTP to send?  What are you using to receive the message?  Can you point me to thest being run?

> Too many CRLF at the end of the message
> ---------------------------------------
>
>                 Key: GERONIMO-4135
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4135
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.1.1
>            Reporter: Stefano Bagnara
>            Assignee: Rick McGuire
>
> We have a lot of tests trying to send a message to james and reading the result: most of the tests fail because the result contains 2 trailing CRLF more than expected (we send one crlf at the end of the message we receive 3 crlf).
> I don't exactly know where does it happen but this does not with sun implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4135) Too many CRLF at the end of the message

Posted by "Rick McGuire (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607248#action_12607248 ] 

Rick McGuire commented on GERONIMO-4135:
----------------------------------------

I've finally managed to hunt down the source of the extra line feeds, and it appears to be coming from the James SMTP code.  In the DataCmdHandler class, the message is getting created using the following code:  

            mail =
                new MailImpl(session.getConfigurationData().getMailServer().getId(),
                             (MailAddress) session.getState().get(SMTPSession.SENDER),
                             recipientCollection,
                             new SequenceInputStream(new SequenceInputStream(headersIn, msgIn),
                                     new ReaderInputStream(new StringReader("\r\n"))));

The outer-most SequenceInputStream() on the last argument is adding an extra CRLF sequence to the stream used to create the message.  Since the content data handler reads the from the stream until it hits the EOF, the extra CRLF gets attached to the end.  I can't find anything in the specifications that indicates a trailing CRLF should be discarded (and indeed, when the message was originally created, it wasn't), nor can I seem to find any reason why this is working with the Sun implementation.  Removing that extra SequenceInputStream makes the problem go away, but I suspect a problem would then show up with the Sun implementation.  At this point, I'm at a loss as to what should be fixed.  



> Too many CRLF at the end of the message
> ---------------------------------------
>
>                 Key: GERONIMO-4135
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4135
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.1.1
>            Reporter: Stefano Bagnara
>            Assignee: Rick McGuire
>
> We have a lot of tests trying to send a message to james and reading the result: most of the tests fail because the result contains 2 trailing CRLF more than expected (we send one crlf at the end of the message we receive 3 crlf).
> I don't exactly know where does it happen but this does not with sun implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.