>>>>> Christian Kruggel writes:
Christian> Hi Juergen!
Christian> A few days ago you answered my question concerning
Christian> javaīs mailto-protocol and the exception produced by
Christian> the appended source:
Christian> java.net.UnknownHostException: mailhost
Juergen> Sounds like a setup problem. Can you ping mailhost?
Christian> No. Another nice GUY suggested to mention the localhost
Christian> as mailhost in /etc/hosts. Appending the line
Christian> "127.0.0.1 mailhost" I was able to ping the
Christian> mailhost. But that seems just to shift the
Christian> problem. Executing the program now leads to a
Christian> ConnectionRefused-Exception ...
Try 'telnet localhost smtp'. I'm pretty sure you'll see the same
problem, i.e. something like 'Connection refused'
As said before, what java tries to do is:
1. Connect to System.getProperty("mail.host") on the smtp port (number
25).
2. If 1 failed connect to localhost on the smtp port
3. If 2 failed lookup mailhost (which is not the same as localhost on
many systems), if mailhost is unknown throw a UnknownHostException
else try to connect to mailhost on the smtp port, if that fails
throw a ConnectException.
The conclusion is that you don't have a Mail Transfer Agent on the
hosts System.getProperty("mail.host"), localhost, and mailhost.
Adding mailhost to /etc/hosts wont help, you have to install and
configure an MTA (exim, sendmail, smail, ...) somewhere. (Another
option is to set the property mail.host to a host that will act
as a mail relay for your host).
Juergen
--
Juergen Kreileder, Blackdown Java-Linux Porting Team
http://www.blackdown.org/java-linux.html
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]