|
|
063c337 |
From 4a92d7ca417a0ebaf92c25c2e9235a9a568e6ba3 Mon Sep 17 00:00:00 2001
|
|
|
063c337 |
From: Jakub Filak <jfilak@redhat.com>
|
|
|
063c337 |
Date: Wed, 16 Mar 2016 09:19:36 +0100
|
|
|
063c337 |
Subject: [PATCH] mailx: stop creating dead.letter on mailx failures
|
|
|
063c337 |
|
|
|
063c337 |
SELinux does not like mailx creating the file and I do not see any
|
|
|
063c337 |
reason to create the file in a problem directory because the file
|
|
|
063c337 |
contains a copy of the email that could not be send.
|
|
|
063c337 |
|
|
|
063c337 |
Failures of EVENT=notify are discoverable in system logs and if you run
|
|
|
063c337 |
the reporter manually, you will see that mailx failed.
|
|
|
063c337 |
|
|
|
063c337 |
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
|
|
063c337 |
---
|
|
|
063c337 |
src/plugins/reporter-mailx.c | 6 ++++++
|
|
|
063c337 |
1 file changed, 6 insertions(+)
|
|
|
063c337 |
|
|
|
063c337 |
diff --git a/src/plugins/reporter-mailx.c b/src/plugins/reporter-mailx.c
|
|
|
063c337 |
index 47943ed..8ab6733 100644
|
|
|
063c337 |
--- a/src/plugins/reporter-mailx.c
|
|
|
063c337 |
+++ b/src/plugins/reporter-mailx.c
|
|
|
063c337 |
@@ -132,6 +132,12 @@ static void create_and_send_email(
|
|
|
063c337 |
*/
|
|
|
063c337 |
putenv((char*)"sendwait=1");
|
|
|
063c337 |
|
|
|
063c337 |
+ /* Prevent mailx from creating dead.letter if sending fails. The file is
|
|
|
063c337 |
+ * useless in our case and if the reporter is called from abrtd, SELinux
|
|
|
063c337 |
+ * complains a lot about mailx touching ABRT data.
|
|
|
063c337 |
+ */
|
|
|
063c337 |
+ putenv((char*)"DEAD=/dev/null");
|
|
|
063c337 |
+
|
|
|
063c337 |
if (notify_only)
|
|
|
063c337 |
log(_("Sending a notification email to: %s"), email_to);
|
|
|
063c337 |
else
|
|
|
063c337 |
--
|
|
|
063c337 |
2.5.5
|
|
|
063c337 |
|