From 8b0bda7b00647c6044e8425780e19bf4863e0749 Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Fri, 14 Jan 2022 16:29:23 +0100 Subject: [PATCH] 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. --- src/engine/smtp/smtp-client-connection.vala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/engine/smtp/smtp-client-connection.vala b/src/engine/smtp/smtp-client-connection.vala index 6cc491f3..5fb91d4e 100644 --- a/src/engine/smtp/smtp-client-connection.vala +++ b/src/engine/smtp/smtp-client-connection.vala @@ -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);