Patch to specify hostname to bind SMTP server to
Brought to you by:
jasonkitchen
Dumbster 1.6 allows the server to listen on any port, but the
hostname is not selectable. This is a simple--and I think backward
compatible--patch so that you can construct a SimpleSmtpServer
instance and specifiy a hostname as well as a port. The hostname
and port can also be specified to the start() method.
Enjoy.
Patch for SimpleSmtpServer.java
Logged In: YES
user_id=752825
Maybe it's just me but I'm really not sure what value this
is adding. What is the purpose of setting the hostname? It
is never accessed from outside of SimpleSmtpServer and is
not passed to any other objects ?
Logged In: YES
user_id=84089
> What is the purpose of setting the hostname?
By default, Java will bind to a port on EVERY IP address on
EVERY ethernet interface available on a host. Many consider
this a security risk since you're listening on something
other than localhost, and any other system on the network
can attempt to connect to your host via port 25.
This patch allows the user to limit Dumbster to bind to a
single IP address and port on a host. Most people will want
to bind to localhost.