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 no...@apache.org on 2010/10/27 12:05:06 UTC
svn commit: r1027884 -
/james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/MessageProcessor.java
Author: norman
Date: Wed Oct 27 10:05:05 2010
New Revision: 1027884
URL: http://svn.apache.org/viewvc?rev=1027884&view=rev
Log:
Correctly parse ipaddresses which are enclosed by () (JAMES-344)
Modified:
james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/MessageProcessor.java
Modified: james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/MessageProcessor.java
URL: http://svn.apache.org/viewvc/james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/MessageProcessor.java?rev=1027884&r1=1027883&r2=1027884&view=diff
==============================================================================
--- james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/MessageProcessor.java (original)
+++ james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/MessageProcessor.java Wed Oct 27 10:05:05 2010
@@ -1451,12 +1451,20 @@ public class MessageProcessor extends Pr
String validatedAddress = null;
int ipAddressStart = domain.indexOf('[');
int ipAddressEnd = -1;
- if (ipAddressStart > -1)
+
+ if (ipAddressStart > -1) {
ipAddressEnd = domain.indexOf(']', ipAddressStart);
- if (ipAddressEnd > -1)
+ } else {
+ // Handle () which enclose the ipaddress
+ // See JAMES-344
+ ipAddressStart = domain.indexOf('(');
+ if (ipAddressStart > -1) {
+ ipAddressEnd = domain.indexOf(')', ipAddressStart);
+ }
+ }
+ if (ipAddressEnd > -1) {
address = domain.substring(ipAddressStart + 1, ipAddressEnd);
- else
- {
+ } else{
int hostNameEnd = domain.indexOf(' ');
if (hostNameEnd == -1)
hostNameEnd = domain.length();
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org