Prefix IPv6-addresses with "IPV6:" in EHLO command.

Fixes issue 1708
This commit is contained in:
cketti 2010-06-03 01:00:24 +00:00
parent 3812c75f66
commit 576078e778

View file

@ -183,8 +183,15 @@ public class SmtpTransport extends Transport
if (localHost.equals(localAddress.getHostAddress()))
{
// IP was returned
localHost = "[" + localHost + "]";
// We don't have a FQDN, so use IP address.
if (localAddress instanceof Inet6Address)
{
localHost = "[IPV6:" + localHost + "]";
}
else
{
localHost = "[" + localHost + "]";
}
}
List<String> results = executeSimpleCommand("EHLO " + localHost);