MIME4J-316 Parts missing in case of a specific combination of boundaries
authorThomas Fricker <tommi.fricker@googlemail.com>
Thu, 19 May 2022 08:11:08 +0000 (10:11 +0200)
committerGitHub <noreply@github.com>
Thu, 19 May 2022 08:11:08 +0000 (15:11 +0700)
commit7e23d5e1cc2bd77f3e5129622472b995cd3f034e
treee9d5fb8b6c7faae12c2ac09f7793c752f1b195bc
parent4ecbe86e4248062fe0cf3dc49f03290fe8904945
MIME4J-316 Parts missing in case of a specific combination of boundaries

The problem can be reproduced by parsing a very specific email structure, where
an inner boundary matches the name of another outer boundary followed by a "-" character.
In the following example, the attached pdf file will be ignored by the parser.

Merge pull request #2 from bluemind-net/bugfix/BM-18542 (#71)

BM-18542 Fix: check for -- boundary ending

Thanks @tommix000 for the fix.
core/src/main/java/org/apache/james/mime4j/io/MimeBoundaryInputStream.java
core/src/test/resources/testmsgs/boundary-name-clash.msg [new file with mode: 0644]
core/src/test/resources/testmsgs/boundary-name-clash.out [new file with mode: 0644]
core/src/test/resources/testmsgs/boundary-name-clash.xml [new file with mode: 0644]
core/src/test/resources/testmsgs/boundary-name-clash_decoded.xml [new file with mode: 0644]
core/src/test/resources/testmsgs/boundary-name-clash_decoded_1_1_1.txt [new file with mode: 0644]
core/src/test/resources/testmsgs/boundary-name-clash_decoded_1_1_2.txt [new file with mode: 0644]
core/src/test/resources/testmsgs/boundary-name-clash_decoded_1_2.bin [new file with mode: 0644]