M
Martin Gregorie
Fair point.Note that it does not include AUTH, so no authentication will be allowed
and the client should not attempt it.
Except that this server really is private: my firewall blocks all inboundThis isn't a good idea. It's an open invitation to spammers to verify
the existence of every recipient in your domain.
connection requests and so its only contact with the outside world are
its outbound SMTP connections to my ISP's mail server when it needs to
send mail. Incoming mail is fetched by getmail and passed to the MTA via
the Postfix.sendmail utility.
OK, that makes sense.I presume that this is due to the fact that the connect() above failed.
You have specified authentication by using a user/password, but the
connection does not allow authentication. When you subsequently use
tr.send() there is no open session so a default session is created which
appears to be to localhost.
Your point about Transport.send() being static would seem to explain the
behaviour I'm seeing, but there's still a heap of anomalies, mainly in
the documentation:
- Transport.send() says that its not a good idea to inherit the
connection from a Session and doesn't provide a suitable way of setting
the hostname (at least its docs don't mention one or mention the use of
properties, though obviously they are used by it.
- now go and look at SMTPTransport. Its documentation includes
example code doing as we did, and getting the connection from Session.
Gaargh!
The double connect is now explained by the Session.connect() making one
connection and Transport.send() making a second