Hello community, here is the log from the commit of package ksmtp for openSUSE:Factory checked in at 2018-01-09 14:46:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ksmtp (Old) and /work/SRC/openSUSE:Factory/.ksmtp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ksmtp" Tue Jan 9 14:46:29 2018 rev:3 rq:559585 version:17.12.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ksmtp/ksmtp.changes 2017-12-22 13:22:39.424036610 +0100 +++ /work/SRC/openSUSE:Factory/.ksmtp.new/ksmtp.changes 2018-01-09 14:46:30.258618861 +0100 @@ -1,0 +2,7 @@ +Sat Dec 23 10:54:48 UTC 2017 - fab...@ritter-vogt.de + +- Add another patch to fix sending of emails with certain servers: + * 0002-Send-the-correct-hostname-with-the-HELO-EHLO-command.patch + * Fixed kde#387926 + +------------------------------------------------------------------- New: ---- 0002-Send-the-correct-hostname-with-the-HELO-EHLO-command.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ksmtp.spec ++++++ --- /var/tmp/diff_new_pack.eJ8KS2/_old 2018-01-09 14:46:30.970585477 +0100 +++ /var/tmp/diff_new_pack.eJ8KS2/_new 2018-01-09 14:46:30.974585289 +0100 @@ -28,6 +28,8 @@ Source0: %{name}-%{version}.tar.xz # PATCH-FIX-UPSTREAM Patch1: 0001-Fix-duplicate-authentication.patch +# PATCH-FIX-UPSTREAM +Patch2: 0002-Send-the-correct-hostname-with-the-HELO-EHLO-command.patch BuildRequires: cyrus-sasl-devel BuildRequires: extra-cmake-modules >= 1.0.0 BuildRequires: kcoreaddons-devel @@ -77,6 +79,7 @@ %prep %setup -q %patch1 -p1 +%patch2 -p1 %build %cmake_kf5 -d build -- -DBUILD_TESTING=ON ++++++ 0002-Send-the-correct-hostname-with-the-HELO-EHLO-command.patch ++++++ >From 3c1a25685355335658b8400eb62b6b0ee2f61714 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fab...@ritter-vogt.de> Date: Fri, 22 Dec 2017 22:32:49 +0100 Subject: [PATCH 2/2] Send the correct hostname with the HELO/EHLO command Summary: It sent the server's hostname previously, which some reject. BUG: 387926 Test Plan: Ran nc as smtp server, uses the right hostname for EHLO now. Reviewers: mlaurent, dvratil Subscribers: #kde_pim Tags: #kde_pim Differential Revision: https://phabricator.kde.org/D9485 --- src/session.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/session.cpp b/src/session.cpp index 4320adc..0be26a9 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -27,6 +27,7 @@ #include "ksmtp_debug.h" #include <QHostAddress> +#include <QHostInfo> #include <QUrl> #include <QEventLoop> #include <QPointer> @@ -82,6 +83,18 @@ void SessionPrivate::setAuthenticationMethods(const QList<QByteArray> &authMetho void SessionPrivate::startHandshake() { + QString hostname = m_customHostname; + + if (hostname.isEmpty()) { + // FIXME: QHostInfo::fromName can get a FQDN, but does a DNS lookup + hostname = QHostInfo::localHostName(); + if (hostname.isEmpty()) { + hostname = QStringLiteral("localhost.invalid"); + } else if (!hostname.contains(QLatin1Char('.'))) { + hostname += QStringLiteral(".localnet"); + } + } + QByteArray cmd; if (!m_ehloRejected) { cmd = "EHLO "; @@ -89,7 +102,6 @@ void SessionPrivate::startHandshake() cmd = "HELO "; } setState(Session::Handshake); - const auto hostname = m_customHostname.isEmpty() ? m_thread->hostName() : m_customHostname; sendData(cmd + QUrl::toAce(hostname)); } -- 2.15.0