On Monday 08 December 2003 18:10, Noel J. Bergman wrote: > Søren Hilmer wrote: > > rawDNSLookup needs to be called twice. I am adding a > > DNSServer.findARecords method to do it > > Why not use InetAddress.getAllByName(String host)? It will get all of the > IP addresses associated with the host.
Well, that ought to work, only InetAddress uses the configured name service on the system, and James has its own DNS setup, so (at least in theory, and we all know that law of Murphy's) there could be differences between the returned results. > > > On Friday 05 December 2003 16:30, Noel J. Bergman wrote: > > > The return is a Collection of String objects. Each one is currently of > > the > > > > form "host", but if we were to handle multi-homed hosts by using > > "host/IP", > > > > it seems to me that we could either parse it directly, or change the > > > way > > we > > > > construct the URLName. > > > > Yes, I also thought of this, but this is a change to the functionality > > of MailetContext, so it will break backwards compatibility. Adding a > > new method will not. > > So, the problem is that the existing method is not doing what we want, and > you are concerned that there might be third party code relying upon that > method, which is fair enough and a good point. Yes, this is my concern. > > In fact, I am curious to know what Jason Webb's company is doing in this > area, since they have a custom delivery mailet, if I recall correctly. > > Unfortunately, I cannot think of a good way to fix the current method > without losing the host name in the log. However, it might be a good idea > to fix the existing method, anyway, even though it would change the log > output. Improved functionality at the expense of the host name in the log. > Someone using the current method would see the IP addresses in the log > instead of the host name, unless they change their code to look it up. > > What do you propose for the new method signature and return type? I propose a method on MailetContext like: /** * This method returns a collection of addresses (A records)for the given * host. * It is guaranteed that the collection will contain at least one element. * @param host to lookup addresses for * @return collection of String's with the IP-addresses of the host. **/ Collection getMailServerAddresses(String host); So basically it mimics the MailetContext.getMailServers(String) method. --Søren -- Søren Hilmer, M.Sc. R&D manager Phone: +45 70 27 64 00 TietoEnator IT+ A/S Fax: +45 70 27 64 40 Ved Lunden 12 Direct: +45 87 46 64 57 DK-8230 Åbyhøj Email: soren.hilmer <at> tietoenator.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]