You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/02/09 01:26:19 UTC
[james-project] 03/06: JAMES-3708 Tests for valid/invalid mail address values on the wikipedia page
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 0c557879739c4deb6651abe271c37e05b6c5807e
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Jan 30 12:15:29 2022 +0700
JAMES-3708 Tests for valid/invalid mail address values on the wikipedia page
---
.../java/org/apache/james/core/MailAddressTest.java | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/core/src/test/java/org/apache/james/core/MailAddressTest.java b/core/src/test/java/org/apache/james/core/MailAddressTest.java
index 4c8624f..a00a789 100644
--- a/core/src/test/java/org/apache/james/core/MailAddressTest.java
+++ b/core/src/test/java/org/apache/james/core/MailAddressTest.java
@@ -49,7 +49,14 @@ class MailAddressTest {
"server-dev@james-apache.org",
"server-dev@[127.0.0.1]",
"server.dev@james.apache.org",
- "\\.server-dev@james.apache.org")
+ "\\.server-dev@james.apache.org",
+ "Abc@10.42.0.1",
+ "Abc.123@example.com",
+ "user+mailbox/department=shipping@example.com",
+ "\"Abc@def\"@example.com",
+ "\"Fred Bloggs\"@example.com",
+ "\"Joe.\\Blow\"@example.com",
+ "!#$%&'*+-/=?^_`.{|}~@example.com")
.map(Arguments::of);
}
@@ -86,7 +93,16 @@ class MailAddressTest {
"server-dev@[127.0.1.-1]",
"\"a..b\"@domain.com", // Javax.mail is unable to handle this so we better reject it
"server-dev\\.@james.apache.org", // Javax.mail is unable to handle this so we better reject it
- "a..b@domain.com")
+ "a..b@domain.com",
+ // According to wikipedia these addresses are valid but as javax.mail is unable
+ // to work with thenm we shall rather reject them (note that this is not breaking retro-compatibility)
+ "Loïc.Accentué@voilà.fr8",
+ "pelé@exemple.com",
+ "δοκιμή@παράδειγμα.δοκιμή",
+ "我買@屋企.香港",
+ "二ノ宮@黒川.日本",
+ "медведь@с-балалайкой.рф",
+ "संपर्क@डाटामेल.भारत")
.map(Arguments::of);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org