Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > cf746698214707f972e669b661d0ae59 > files > 17

kdepim4-4.14.10-1.3.mga5.src.rpm

From 78a8c9324afeb9881d93ec2aca845ddafa30514f Mon Sep 17 00:00:00 2001
From: David Jarvie <djarvie@kde.org>
Date: Wed, 28 Oct 2015 21:51:46 +0000
Subject: [PATCH 17/74] Bug 338575: Warn user if mail fails to send, if using
 sendmail

Mails will silently fail to send when using the sendmail option, if
akonadi_mailfilter_agent is not installed. The MailTransport job
doesn't provide feedback that sending has failed in these
circumstances. Fixed by simply checking whether the executable is
installed.

Note that sendmail support is being dropped in KDE 5, so it isn't
worth the significant effort of doing it properly by fixing
MailTransport to give feedback.
---
 kalarm/Changelog  | 3 ++-
 kalarm/kamail.cpp | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/kalarm/Changelog b/kalarm/Changelog
index ba22537cda..c13a992023 100644
--- a/kalarm/Changelog
+++ b/kalarm/Changelog
@@ -1,8 +1,9 @@
 KAlarm Change Log
 
-=== Version 2.10.13 --- 24 September 2015 ===
+=== Version 2.10.13 --- 28 Octember 2015 ===
 - Fix conversion error in sub-repetition value from command line or D-Bus command.
 - Enable typing into New Alarm dialogue while alarm is displayed (Unity desktop) [KDE Bug 352889]
+- Warn user if sendmail fails due to akonadi_mailfilter_agent not installed [KDE Bug 338575]
 
 === Version 2.10.12 (KDE 4.14.2) --- 30 September 2014 ===
 - Make New Audio Alarm dialogue use sound file repeat preference setting.
diff --git a/kalarm/kamail.cpp b/kalarm/kamail.cpp
index 9b5e668ed1..accade82ee 100644
--- a/kalarm/kamail.cpp
+++ b/kalarm/kamail.cpp
@@ -160,6 +160,12 @@ int KAMail::send(JobData& jobdata, QStringList& errmsgs)
     if (Preferences::emailClient() == Preferences::sendmail)
     {
         kDebug() << "Sending via sendmail";
+        if (KStandardDirs::findExe(QLatin1String("akonadi_mailfilter_agent")).isEmpty())
+        {
+            kError() << "Sendmail requires akonadi_mailfilter_agent to be installed";
+            errmsgs = errors(i18nc("@info", "Sendmail option requires <filename>%1</filename> to be installed", QLatin1String("akonadi_mailfilter_agent")));
+            return -1;
+        }
         const QList<MailTransport::Transport*> transports = manager->transports();
         for (int i = 0, count = transports.count();  i < count;  ++i)
         {
@@ -189,7 +195,7 @@ int KAMail::send(JobData& jobdata, QStringList& errmsgs)
     {
         kDebug() << "Sending via KDE";
         const int transportId = identity.transport().isEmpty() ? -1 : identity.transport().toInt();
-        transport = manager->transportById( transportId, true );
+        transport = manager->transportById(transportId, true);
         if (!transport)
         {
             kError() << "No mail transport found for identity" << identity.identityName() << "uoid" << identity.uoid();
-- 
2.14.1