It appears that the logic used to replace root@localhost with root@cheetah works as intended for the email headers, but does not apply to the address used as the sender address (the envelope) when sending the email message.
that the msg type is converted to a string to form the complete email headers/body (I may be butchering this description) as the last argument to the s.sendmail() call.
The first part of the s.sendmail() call appears to use the email_from value as-is without any conversion, so if the configuration has root@localhost, then this is used as-is for the first argument in the s.sendmail() function call.
Let's assume that the system is named cheetah.
It appears that the logic used to replace
root@localhost
withroot@cheetah
works as intended for the email headers, but does not apply to the address used as the sender address (the envelope) when sending the email message.This code:
https://github.com/rpm-software-management/yum/blob/f8616a2d6e22705371fe6ba47597238d3d1dc2f1/yum-cron/yum-cron.py#L244-L247
appears to replace
root@localhost
withroot@cheetah
and store the result indomain
. Thedomain
variable is then used here:https://github.com/rpm-software-management/yum/blob/f8616a2d6e22705371fe6ba47597238d3d1dc2f1/yum-cron/yum-cron.py#L247 to form
msg['From']
.We can see here:
https://github.com/rpm-software-management/yum/blob/f8616a2d6e22705371fe6ba47597238d3d1dc2f1/yum-cron/yum-cron.py#L254
that the
msg
type is converted to a string to form the complete email headers/body (I may be butchering this description) as the last argument to thes.sendmail()
call.The first part of the
s.sendmail()
call appears to use theemail_from
value as-is without any conversion, so if the configuration hasroot@localhost
, then this is used as-is for the first argument in thes.sendmail()
function call.Is this intentional?
Looking here:
https://github.com/rpm-software-management/yum/blob/f8616a2d6e22705371fe6ba47597238d3d1dc2f1/etc/yum-cron.conf#L33-L36
and here:
https://github.com/rpm-software-management/yum/blob/f8616a2d6e22705371fe6ba47597238d3d1dc2f1/etc/yum-cron.conf#L50-L59
I don't see this behavior documented as intentional.
Is this a documentation problem or is the
s.sendmail()
function call intended to be called this way: