Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIME4J-326 SILENT monitor for header decoding #97

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assemble/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>apache-mime4j-project</artifactId>
<groupId>org.apache.james</groupId>
<version>0.8.10-SNAPSHOT</version>
<version>0.8.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>apache-mime4j-project</artifactId>
<groupId>org.apache.james</groupId>
<version>0.8.10-SNAPSHOT</version>
<version>0.8.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>apache-mime4j-project</artifactId>
<groupId>org.apache.james</groupId>
<version>0.8.10-SNAPSHOT</version>
<version>0.8.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public void copyQuotedContent(final ByteSequence buf, final ParserCursor cursor,

String decoded = ContentUtil.decode(dstRaw);
if (decoded.startsWith("=?")) {
decoded = DecoderUtil.decodeEncodedWords(decoded, DecodeMonitor.STRICT);
decoded = DecoderUtil.decodeEncodedWords(decoded, DecodeMonitor.SILENT);
}

dst.append(decoded);
Expand Down
2 changes: 1 addition & 1 deletion dom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>apache-mime4j-project</artifactId>
<groupId>org.apache.james</groupId>
<version>0.8.10-SNAPSHOT</version>
<version>0.8.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ public void testEmbeddedQuotes() throws Exception {
Assert.assertEquals("=?utf-8?Q?Dupont,_Gr=C3=A9goire", mailbox.getName());
}

@Test
public void shouldTolerateMalformedEncoding() throws Exception {
String s = "\"=?windows-1251?B?onsonsmekqixrbahkinyv?=\" <atfilpd@louisphaethon.co.ua>";
ByteSequence raw = ContentUtil.encode(s);
ParserCursor cursor = new ParserCursor(0, s.length());

Mailbox address = (Mailbox) parser.parseAddress(raw, cursor, RawFieldParser.INIT_BITSET(','));

Assert.assertEquals("atfilpd@louisphaethon.co.ua", address.getAddress());
Assert.assertEquals("ў{(ћЙћ’Ё±\u00AD¶Ў’)т", address.getName());
}

@Test
public void testParseAddressTruncated() throws Exception {
String s = "< some one ";
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>apache-mime4j-project</artifactId>
<groupId>org.apache.james</groupId>
<version>0.8.10-SNAPSHOT</version>
<version>0.8.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion james-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j-project</artifactId>
<version>0.8.10-SNAPSHOT</version>
<version>0.8.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion mbox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j-project</artifactId>
<version>0.8.10-SNAPSHOT</version>
<version>0.8.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j-project</artifactId>
<version>0.8.10-SNAPSHOT</version>
<version>0.8.11-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Apache James :: Mime4j :: Project</name>
Expand Down
2 changes: 1 addition & 1 deletion storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>apache-mime4j-project</artifactId>
<groupId>org.apache.james</groupId>
<version>0.8.10-SNAPSHOT</version>
<version>0.8.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down