Sender email address does not appear to be treated the same way for the envelope level as it is for email headers
atc0005 opened this issue · 0 comments
Let's assume that the system is named cheetah.
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.
This code:
Lines 244 to 247 in f8616a2
appears to replace root@localhost
with root@cheetah
and store the result in domain
. The domain
variable is then used here:
Line 247 in f8616a2
msg['From']
.
We can see here:
Line 254 in f8616a2
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.
Is this intentional?
Looking here:
Lines 33 to 36 in f8616a2
and here:
Lines 50 to 59 in f8616a2
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:
s.sendmail(msg['From'], self.opts.email_to, msg.as_string())