make InetAddress.getLocalHost() and hello_name usage consistent across the
application
--------------------------------------------------------------------------------------
Key: JAMES-623
URL: http://issues.apache.org/jira/browse/JAMES-623
Project: James
Issue Type: Improvement
Components: DNSServer, FetchMail, James Core, Matchers/Mailets
(bundled), Remote Delivery, SMTPServer
Reporter: Stefano Bagnara
Fix For: Trunk
We currently (in trunk) have the following usages:
A. core.AbstractJamesService.
- read the helloName configuration.
- if autodetect is true then try "InetAddress.getLocalHost().getHostName()" and
on exception "localhost"
- otherwise it uses the "localhost" child of helloHame.
B. dnsserver.DNSServer.
- in initialize(), if no dnsserver has been added try to add
"InetAddress.getLocalHost().getHostName()" and revert to "127.0.0.1" on
exception
C. fetchmail.MessageProcessor
- computing a remote address, if it does not find the domain part it append the
localhost and calulate it this way:
InetAddress.getByName(InetAddress.getByName(InetAddress.getLocalHost().getHostAddress()).getHostName()).getHostName()
and default to "[127.0.0.1]" on exception.
D. fetchmail.ParsedConfiguration
- to compute default domain name:
InetAddress.getByName(InetAddress.getLocalHost().getHostAddress()).getHostName();
and defaults to "localhost" on exception
E. transport.mailets.AbstractRedirect, AbstractVirtualUserTable, DSNBounce
- to set the RemoteAddr and RemoteHost for a locally generated mail:
java.net.InetAddress.getLocalHost().getHostAddress() with fallback to
"127.0.0.1" and InetAddress.getLocalHost().getHostName() with fallback to
"localhost".
F. transport.mailets.RemoteDelivery and DSNBounce
- to set the text part of a bounce message
InetAddress.getLocalHost().getHostName() and fallback to [address unknown]
(replace "[machine]" machine pattern with the result of the localhost).
G. James
- hostname = InetAddress.getLocalHost().getHostName() with fallback to
"localhost".
- put this in DefaultContext in the "HostName" key: not used by anyone.
- if <servernames>/<autodetect> is true and hostname is not "localhost" add it
to servernames (but lowercase it before).
- use it as fallback as domain part of postmaster if no other servername (not
autodected and not "localhost" has been found).
I'll try to define a proposal to fix this, later. Now I just wanted to share
the result of a code review about this issue.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]