engine: Don't use domain for EHLO if it's not FQDN

This works around the combination of poorly configured system and an
SMTP server that really wants a FQDN and otherwise reject the EHLO
command.
This commit is contained in:
Julian Stecklina 2022-01-14 16:29:23 +01:00
parent 6d5032914d
commit 8b0bda7b00

View file

@ -199,6 +199,11 @@ internal class Geary.Smtp.ClientConnection : BaseObject, Logging.Source {
}
}
if (!String.is_empty(fqdn) && !("." in fqdn)) {
debug("Ignoring hostname, because it is not a FQDN: %s", fqdn);
fqdn = null;
}
// try EHLO first, then fall back on HELO
EhloRequest ehlo = !String.is_empty(fqdn) ? new EhloRequest(fqdn) : new EhloRequest.for_local_address(local_addr);
Response response = yield transaction_async(ehlo, cancellable);