Merge pull request #448 from PeterLaemmle/develop

E-Mail plugin: Create MIME-compliant header that can contain any kind of string
This commit is contained in:
Bastian Schroll 2020-04-21 07:46:43 +02:00 committed by GitHub
commit 23e7406f48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -8,6 +8,7 @@
##### Removed
##### Fixed
- MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. [#447](https://github.com/Schrolli91/BOSWatch/pull/447)
- E-Mail plugin: Create MIME-compliant header that can contain any kind of string. [#448](https://github.com/Schrolli91/BOSWatch/pull/448)
##### Security

View file

@ -13,6 +13,7 @@ import logging # Global logger
import smtplib #for the SMTP client
from email.mime.text import MIMEText # Import the email modules we'll need
from email.header import Header # Import the email modules we'll need
from email.utils import formatdate # need for confirm to RFC2822 standard
from email.utils import make_msgid # need for confirm to RFC2822 standard
@ -61,7 +62,7 @@ def doSendmail(server, subject, mailtext):
msg = MIMEText(mailtext, 'plain', 'UTF-8')
msg['From'] = globalVars.config.get("eMail", "from")
msg['To'] = globalVars.config.get("eMail", "to")
msg['Subject'] = subject
msg['Subject'] = Header(subject, 'UTF-8')
msg['Date'] = formatdate()
msg['Message-Id'] = make_msgid()
msg['Priority'] = globalVars.config.get("eMail", "priority")