Allow to specify mail from header

sSMTP requires a [config flag](https://tosbourn.com/allowing-your-own-from-header-with-ssmtp/) to allow setting the header.
This commit is contained in:
Dennis Reimann 2020-06-27 22:14:36 +02:00
parent 1e5201858e
commit f8e953a0e4
No known key found for this signature in database
GPG Key ID: 5009E1797F03F8D0
2 changed files with 4 additions and 2 deletions

View File

@ -93,6 +93,7 @@ def mail(recipient=None, message=None, subject=None, cert=None, encrypt=False,
print("send mail")
print("msg: {}".format(message))
print("to: {}".format(recipient))
print("from: {} <{}>".format(from_name, from_address))
print("subject: {}".format(subject))
print("cert: {}".format(cert))
print("encrypt: {}".format(encrypt))
@ -103,7 +104,7 @@ def mail(recipient=None, message=None, subject=None, cert=None, encrypt=False,
msg_content = [
"To: {}".format(recipient),
'From: "{} <{}>'.format(from_name, from_address),
'From: {} <{}>'.format(from_name, from_address),
"Subject: {}".format(subject),
"",
"{}".format(message)
@ -118,7 +119,7 @@ def mail(recipient=None, message=None, subject=None, cert=None, encrypt=False,
msg = EmailMessage()
msg['Subject'] = "{}".format(subject)
msg['From'] = '"{} <{}>'.format(from_name, from_address),
msg['From'] = '{} <{}>'.format(from_name, from_address),
msg['To'] = recipient
msg.set_payload(message)

View File

@ -95,6 +95,7 @@ Mailhub=${notifyMailServer}
AuthUser=${notifyMailUser}
AuthPass=${notifyMailPass}
UseSTARTTLS=YES
FromLineOverride=YES
EOF
# edit raspi blitz config