Noel J. Bergman wrote:
mmm... "unknown", [IP] or null (compatibility)? I do not see it very clear
in http://java.sun.com/j2se/1.5.0/docs/api/java/net/InetAddress.html#getHostName()
As I said, InetAddress and dnsjava do not always exhibit the same behavior.
That's one reason why we only changed JAMES to use dnsjava where proper TTL
handling was important. Otherwise, we left it using the standard Java API. If
we are going to use dnsjava more broadly (and *not* directly in Matchers and
Mailets), we'll likely encounter additional nuances.
The problem is that if we use 2 services we'll have 2 caches to monitor
and manage and this does not make so much sense.
We should probably expose more used parameters (hostname/address of the
sender) via mailetContext so we can serve them via our DNSService.
To answer the question asked by you, Norman and Stefano, see
getHostFromNameService in InetAddress.
--- Noel
Yes, they never return exceptions but catch them and return the hostaddress:
---
} catch (SecurityException e) {
host = addr.getHostAddress();
} catch (UnknownHostException e) {
host = addr.getHostAddress();
}
----
If we want to replace it with dnsjava we should make sure we do the same
to avoid compatibility problems.
PS: the java.net class also checks for spoofing running a getAllByName0
on the resulting host to check that the IP address is in the list of the
forward conversion.
Stefano
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]