M
Martin Gregorie
I seem to have found a JavaMail-1.4.4 bug
If I try to open an SMTP connection by obtaining a transport instance
and then calling connect():
Transport tr = sesh.getTransport("smtp");
tr.connect(host, user, password);
where:
sesh is the current mail session,
host is "zoogz.gregorie.org"
user is "kiwi"
and password is a valid password for the user
Transport.connect() sets up the URLName "smtp://[email protected]",
which is what I expect, but then promptly fails with:
javax.mail.MessagingException:
Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused
when the local Postfix MTA on the machine I'm connecting from
(zappa.gregorie.org) is stopped.
If I restart the local Postfix instance the connect request succeeds and
the mail message is sent, but its headers clearly show that JavaMail
delivered it to the local MTA, which then passed it to the Postfix MTA on
zoogz.gregorie.org, which has been listening on port 25 the whole time.
IOW the Transport.connect(host,user,password) method sets up its target
URL as expected but then promptly ignores it and defaults to connecting
to localhost on port 25.
Have any of you seen this problem?
Have I done anything stupid?
Is there a workround?
If I try to open an SMTP connection by obtaining a transport instance
and then calling connect():
Transport tr = sesh.getTransport("smtp");
tr.connect(host, user, password);
where:
sesh is the current mail session,
host is "zoogz.gregorie.org"
user is "kiwi"
and password is a valid password for the user
Transport.connect() sets up the URLName "smtp://[email protected]",
which is what I expect, but then promptly fails with:
javax.mail.MessagingException:
Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused
when the local Postfix MTA on the machine I'm connecting from
(zappa.gregorie.org) is stopped.
If I restart the local Postfix instance the connect request succeeds and
the mail message is sent, but its headers clearly show that JavaMail
delivered it to the local MTA, which then passed it to the Postfix MTA on
zoogz.gregorie.org, which has been listening on port 25 the whole time.
IOW the Transport.connect(host,user,password) method sets up its target
URL as expected but then promptly ignores it and defaults to connecting
to localhost on port 25.
Have any of you seen this problem?
Have I done anything stupid?
Is there a workround?