Blob Blame History Raw
From 8cc3a91e7f07365d760d8716067ba03bb0d53aa7 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Wed, 27 Aug 2014 09:07:54 +0200
Subject: [PATCH 24/33] mailx: print only one log message in notify_only mode

Related to rhbz#1133674

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/plugins/reporter-mailx.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/plugins/reporter-mailx.c b/src/plugins/reporter-mailx.c
index 92e78a4..caacbe8 100644
--- a/src/plugins/reporter-mailx.c
+++ b/src/plugins/reporter-mailx.c
@@ -132,7 +132,11 @@ static void create_and_send_email(
      */
     putenv((char*)"sendwait=1");
 
-    log(_("Sending an email..."));
+    if (notify_only)
+        log(_("Sending a notification email to: %s"), email_to);
+    else
+        log(_("Sending an email..."));
+
     exec_and_feed_input(dsc, args);
 
     free(dsc);
@@ -154,8 +158,9 @@ static void create_and_send_email(
             free(msg);
             dd_close(dd);
         }
+        log(_("Email was sent to: %s"), email_to);
     }
-    log(_("Email was sent to: %s"), email_to);
+
     free(email_to);
 }
 
-- 
2.1.0