projects
/
org.ibex.mail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5de1642
)
ignore exceptions thrown by InetAddress.getByName()
author
adam
<adam@megacz.com>
Mon, 22 Jun 2009 00:10:33 +0000
(
00:10
+0000)
committer
adam
<adam@megacz.com>
Mon, 22 Jun 2009 00:10:33 +0000
(
00:10
+0000)
darcs-hash:
20090622001033
-5007d-
f1f6483ff11708805af32948011db08fa93c41c5
.gz
src/org/ibex/mail/DNSUtil.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/mail/DNSUtil.java
b/src/org/ibex/mail/DNSUtil.java
index
3e066c7
..
403ff1a
100644
(file)
--- a/
src/org/ibex/mail/DNSUtil.java
+++ b/
src/org/ibex/mail/DNSUtil.java
@@
-9,6
+9,9
@@
import org.xbill.DNS.Message;
import javax.naming.*;
import javax.naming.directory.*;
import javax.naming.*;
import javax.naming.directory.*;
+
+// FEATURE: use DNSJava for reverse lookups?
+// FEATURE: investigate other cool stuff in DNSJava we can use
public class DNSUtil {
public static String reverseLookup(InetAddress ip) throws IOException {
public class DNSUtil {
public static String reverseLookup(InetAddress ip) throws IOException {
@@
-45,9
+48,13
@@
public class DNSUtil {
// FIXME we should be sorting here
mx = mx.substring(mx.indexOf(" ") + 1);
if (mx.charAt(mx.length() - 1) == '.') mx = mx.substring(0, mx.length() - 1);
// FIXME we should be sorting here
mx = mx.substring(mx.indexOf(" ") + 1);
if (mx.charAt(mx.length() - 1) == '.') mx = mx.substring(0, mx.length() - 1);
- InetAddress ia = InetAddress.getByName(mx);
- if (ia.equals(IP.getIP(127,0,0,1)) || ia.isLoopbackAddress()) continue;
- ret[i++] = ia;
+ try {
+ InetAddress ia = InetAddress.getByName(mx);
+ if (ia.equals(IP.getIP(127,0,0,1)) || ia.isLoopbackAddress()) continue;
+ ret[i++] = ia;
+ } catch (Exception e) {
+ Log.info("safe to ignore", e);
+ }
}
}
} catch (Exception e) {
}
}
} catch (Exception e) {