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 "Stefano Bagnara (JIRA)" <se...@james.apache.org> on 2008/07/14 14:13:32 UTC

[jira] Created: (MIME4J-54) boundaries should only be found at the beginning of a line

boundaries should only be found at the beginning of a line
----------------------------------------------------------

                 Key: MIME4J-54
                 URL: https://issues.apache.org/jira/browse/MIME4J-54
             Project: Mime4j
          Issue Type: Bug
    Affects Versions: 0.4
            Reporter: Stefano Bagnara
             Fix For: 0.4


current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Updated: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara updated MIME4J-54:
----------------------------------

    Attachment:     (was: boundary-tests.zip)

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip, MIME4J-54.patch
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Resolved: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara resolved MIME4J-54.
-----------------------------------

    Resolution: Fixed

Applied.

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>            Assignee: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip, MIME4J-54-complete.patch, MIME4J-54.patch, testmsgs-endingboundaries-complete.zip
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Commented: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613323#action_12613323 ] 

Stefano Bagnara commented on MIME4J-54:
---------------------------------------

RFC states boundaries having 0 or more spaces at the end of the boundary before the CRLF should be correctly interpreted as boundaries.

from the rfc:
================================
encapsulation := delimiter transport-padding
                      CRLF body-part
================================
and also
================================
"Composers MUST NOT generate non-zero length transport
padding, but receivers MUST be able to handle padding
added by message transports."
================================

I added this check to "intermediate-boundaries.msg"

The rfc also report this text while discussing the ending boundary:
==================================
NOTE TO IMPLEMENTORS:  Boundary string comparisons must compare the
boundary value with the beginning of each candidate line.  An exact
match of the entire candidate line is not required; it is sufficient
that the boundary appear in its entirety following the CRLF.
=====================================

How do you read it?
Is a line having "--XXX--something" a correct ending delimiter for the "XXX" boundary?
Does this apply to intermediate delimiters?

I already created test messages and expected results, but we should fix expected results based on our understanding of the rfc first, and then try to fix the code.

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Commented: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Oleg Kalnichevski (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615377#action_12615377 ] 

Oleg Kalnichevski commented on MIME4J-54:
-----------------------------------------

Works for me.

Oleg

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip, MIME4J-54.patch
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Updated: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara updated MIME4J-54:
----------------------------------

    Attachment: boundary-tests.zip

Attached a couple of tests about misplaced boundaries so we can remove them from the repository while we don't have a fix for this (accomodating Robert's request).

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Updated: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara updated MIME4J-54:
----------------------------------

    Attachment: MIME4J-54.patch

This make sure we only find boundaries at the start of a line.
This does not do any change to the garbage found after the boundary.
That will require some more code to be fixed (let's first agree on what has to be done)

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip, MIME4J-54.patch
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Commented: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Niklas Therning (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615294#action_12615294 ] 

Niklas Therning commented on MIME4J-54:
---------------------------------------

IMO, boundaries should only be matched at the beginning of a line. A MUA which creates messages with boundaries in the middle of lines is severely broken (I've never seen one). In that case it's probably some sort of spam software.

As for the question about garbage after a boundary I think the correct thing would be to regard any line as a boundary which has the boundary string (with or without --) as a prefix.

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Updated: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara updated MIME4J-54:
----------------------------------

    Attachment: testmsgs-endingboundaries-complete.zip
                MIME4J-54-complete.patch

Updated code and updated tests.
Now after a boundary is found we skip and *IGNORE* anything until we find a newline.

Please note I incorporated skipNewLine in skipBoundary and I also had to move the if (eof) check just before the fillBuffer because it was not skipping anything in the case the buffer was already the last for the stream (maybe this was another bug, but I'm not sure).

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip, MIME4J-54-complete.patch, MIME4J-54.patch, testmsgs-endingboundaries-complete.zip
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Assigned: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara reassigned MIME4J-54:
-------------------------------------

    Assignee: Stefano Bagnara

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>            Assignee: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip, MIME4J-54-complete.patch, MIME4J-54.patch, testmsgs-endingboundaries-complete.zip
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Updated: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara updated MIME4J-54:
----------------------------------

    Attachment: boundary-tests.zip

Updated/Fixed test resources

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip, MIME4J-54.patch
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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


[jira] Commented: (MIME4J-54) boundaries should only be found at the beginning of a line

Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-54?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615397#action_12615397 ] 

Robert Burrell Donkin commented on MIME4J-54:
---------------------------------------------

I agree with Niklas et al that it's best to regard any line prefixed by the boundary string as a boundary

Robert

> boundaries should only be found at the beginning of a line
> ----------------------------------------------------------
>
>                 Key: MIME4J-54
>                 URL: https://issues.apache.org/jira/browse/MIME4J-54
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Stefano Bagnara
>             Fix For: 0.4
>
>         Attachments: boundary-tests.zip, MIME4J-54.patch
>
>
> current mime4j seems to be fooled by mime boundaries inside lines of text parts (not at the beginnning of a line).
> I committed misplaced-boundary.msg example message to show the issue and the expected result.

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


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