diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2017-12-24 14:56:44 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2017-12-25 10:51:59 +0100 |
commit | c634bf219b9940634a17c52c3d4b2a9686178adf (patch) | |
tree | 16218604b87a8ec03bd17a84c0fa785f582bb873 /kde-apps/ksmtp | |
parent | dev-ruby/ruby_dep: amd64 stable (diff) | |
download | gentoo-c634bf219b9940634a17c52c3d4b2a9686178adf.tar.gz gentoo-c634bf219b9940634a17c52c3d4b2a9686178adf.tar.bz2 gentoo-c634bf219b9940634a17c52c3d4b2a9686178adf.zip |
kde-apps/ksmtp: Send correct hostname
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=387926
Package-Manager: Portage-2.3.19, Repoman-2.3.6
Diffstat (limited to 'kde-apps/ksmtp')
-rw-r--r-- | kde-apps/ksmtp/files/ksmtp-17.12.0-correct-hostname.patch | 65 | ||||
-rw-r--r-- | kde-apps/ksmtp/ksmtp-17.12.0-r2.ebuild | 27 |
2 files changed, 92 insertions, 0 deletions
diff --git a/kde-apps/ksmtp/files/ksmtp-17.12.0-correct-hostname.patch b/kde-apps/ksmtp/files/ksmtp-17.12.0-correct-hostname.patch new file mode 100644 index 000000000000..8860c59ebfde --- /dev/null +++ b/kde-apps/ksmtp/files/ksmtp-17.12.0-correct-hostname.patch @@ -0,0 +1,65 @@ +From 5199ed07428a03f1aa340da3ae99fcfa62ba2751 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt <fabian@ritter-vogt.de> +Date: Fri, 22 Dec 2017 22:32:49 +0100 +Subject: 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)); + } + +-- +cgit v0.11.2 + diff --git a/kde-apps/ksmtp/ksmtp-17.12.0-r2.ebuild b/kde-apps/ksmtp/ksmtp-17.12.0-r2.ebuild new file mode 100644 index 000000000000..42d615782b26 --- /dev/null +++ b/kde-apps/ksmtp/ksmtp-17.12.0-r2.ebuild @@ -0,0 +1,27 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +KDE_TEST="true" +inherit kde5 + +DESCRIPTION="Job-based library to send email through an SMTP server" +LICENSE="LGPL-2.1+" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND=" + $(add_frameworks_dep kcoreaddons) + $(add_frameworks_dep ki18n) + $(add_frameworks_dep kio) + $(add_kdeapps_dep kmime) + $(add_qt_dep qtnetwork) + dev-libs/cyrus-sasl +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/${P}-ehlo-auth-fix.patch" + "${FILESDIR}/${P}-correct-hostname.patch" +) |