mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 05:02:26 -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
|
||||
executeSimpleCommand(null);
|
||||
|
||||
String localHost = "localhost";
|
||||
String localHost = "localhost.localdomain";
|
||||
try {
|
||||
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) {
|
||||
if (Config.LOGD) {
|
||||
if (k9.DEBUG) {
|
||||
|
Loading…
Reference in New Issue
Block a user