The attached patch fixes the use of email addresses in yum-cron.

There were two problems. First, it is not wise to append '@localhost' to
the addresses, because that is not a FQDN and the MTA appends domain to
get a FQDN. E.g. the default configuration of postfix appends $myorigin
(same as $myhostname by default) to a non-FQDN. This results in
'root@localhost' being expanded to 'r...@localhost.hostname.example.com'.
I don't think that makes sense. Sending the mail from plain 'root' gives
us 'r...@hostname.example.com', which is nice. Adjust 'yum-cron.conf'
accordingly.

This was already the default in 'yum-cron-hourly.conf'.

Secondly, according to the code in 'yum-cron/yum-cron.py' and
'yum-updatesd.py' the default 'email_from' is not 'yum-updatesd@localhost' as
advertised in docs/yum-updatesd.conf.5, but 'root'. Adjust the man page
accordingly.

Please CC me as I am not subscribed to the list.

-Markus
From 2236dd858d5a05e0e4738535cfd1087b290628df Mon Sep 17 00:00:00 2001
From: Markus Rothe <markusr...@gmail.com>
Date: Fri, 20 Mar 2015 12:20:04 +0100
Subject: [PATCH] Fix the use of email addresses

There were two problems. First, it is not wise to append '@localhost' to
the addresses, because that is not a FQDN and the MTA appends domain to
get a FQDN. E.g. the default configuration of postfix appends $myorigin
(same as $myhostname by default) to a non-FQDN. This results in
'root@localhost' being expanded to 'r...@localhost.hostname.example.com'.
I don't think that makes sense. Sending the mail from plain 'root' gives
us 'r...@hostname.example.com', which is nice. Adjust 'yum-cron.conf'
accordingly.

This was already the default in 'yum-cron-hourly.conf'.

Secondly, according to the code in 'yum-cron/yum-cron.py' and
'yum-updatesd.py' the default 'email_from' is not 'yum-updatesd@localhost' as
advertised in docs/yum-updatesd.conf.5, but 'root'. Adjust the man page
accordingly.
---
 docs/yum-updatesd.conf.5 | 6 ++----
 etc/yum-cron.conf        | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/docs/yum-updatesd.conf.5 b/docs/yum-updatesd.conf.5
index ee6e7aa..4a4e267 100644
--- a/docs/yum-updatesd.conf.5
+++ b/docs/yum-updatesd.conf.5
@@ -44,12 +44,10 @@ updating as well.  Defaults to False.
 
 .SH "MAIL OPTIONS"
 .IP \fBemail_to\fR
-List of email addresses to send update notification to.  Defaults to 
-`root@localhost'.
+List of email addresses to send update notification to.  Defaults to `root'.
 
 .IP \fBemail_from\fR
-Email address for update notifications to be from.  Defaults to 
-`yum-updatesd@localhost'.
+Email address for update notifications to be from.  Defaults to `root'.
 
 .SH "SYSLOG OPTIONS"
 .IP \fBsyslog_facility\fR
diff --git a/etc/yum-cron.conf b/etc/yum-cron.conf
index 960fcc9..f84e3c2 100644
--- a/etc/yum-cron.conf
+++ b/etc/yum-cron.conf
@@ -49,7 +49,7 @@ output_width = 80
 
 [email]
 # The address to send email messages from.
-email_from = root@localhost
+email_from = root
 
 # List of addresses to send messages to.
 email_to = root
-- 
2.3.0

_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to