mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-11 05:09:40 +02:00
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:
parent
1e5201858e
commit
f8e953a0e4
@ -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)
|
||||
|
@ -95,6 +95,7 @@ Mailhub=${notifyMailServer}
|
||||
AuthUser=${notifyMailUser}
|
||||
AuthPass=${notifyMailPass}
|
||||
UseSTARTTLS=YES
|
||||
FromLineOverride=YES
|
||||
EOF
|
||||
|
||||
# edit raspi blitz config
|
||||
|
Loading…
x
Reference in New Issue
Block a user