chibenwa commented on code in PR #2396:
URL: https://github.com/apache/james-project/pull/2396#discussion_r1735666545
##########
protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/EhloCmdHandler.java:
##########
@@ -102,7 +102,13 @@ private boolean isValid(String argument) {
// Guava tries parsing IPv6 if and only if wrapped by []
|| InetAddresses.isUriInetAddress("[" +
removeEmIPV6Prefix(hostname) + "]")
|| InternetDomainName.isValid(hostname)
- || emClientCompatibility(hostname);
+ || emClientCompatibility(hostname)
+ || isAlphanumeric(hostname);
+ }
+
+ // CF JAMES-4046
https://issues.apache.org/jira/projects/JAMES/issues/JAMES-4066
+ private boolean isAlphanumeric(String hostname) {
+ return hostname.matches("^[a-zA-Z0-9]+$");
Review Comment:
Please use `CharMatcher` and not regexps
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]