mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
use 'localhost.localdomain' instead of 'localhost' when sending mail by smtp. This makes more mail servers happy
This commit is contained in:
parent
cb900a83fe
commit
0d0fb8a3b3
@ -138,10 +138,16 @@ public class SmtpTransport extends Transport {
|
|||||||
// Eat the banner
|
// Eat the banner
|
||||||
executeSimpleCommand(null);
|
executeSimpleCommand(null);
|
||||||
|
|
||||||
String localHost = "localhost";
|
String localHost = "localhost.localdomain";
|
||||||
try {
|
try {
|
||||||
InetAddress localAddress = InetAddress.getLocalHost();
|
InetAddress localAddress = InetAddress.getLocalHost();
|
||||||
localHost = localAddress.getHostName();
|
if (! localAddress.isLoopbackAddress()) {
|
||||||
|
// The loopback address will resolve to 'localhost'
|
||||||
|
// some mail servers only accept qualified hostnames, so make sure
|
||||||
|
// never to override "localhost.localdomain" with "localhost"
|
||||||
|
// TODO - this is a hack. but a better hack than what was there before
|
||||||
|
localHost = localAddress.getHostName();
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (Config.LOGD) {
|
if (Config.LOGD) {
|
||||||
if (k9.DEBUG) {
|
if (k9.DEBUG) {
|
||||||
|
Loading…
Reference in New Issue
Block a user