diff --git a/docs/docs/configuration/server.rst b/docs/docs/configuration/server.rst index c3713b9..45f2f79 100644 --- a/docs/docs/configuration/server.rst +++ b/docs/docs/configuration/server.rst @@ -184,7 +184,7 @@ to recipient address, e.g. your email address from - sender address, e.g. isso@example.tld + sender address, e.g. `"Foo Bar" ` timeout specify a timeout in seconds for blocking operations like the diff --git a/isso/core.py b/isso/core.py index bd886c7..30d2564 100644 --- a/isso/core.py +++ b/isso/core.py @@ -8,6 +8,7 @@ import logging import threading import multiprocessing +from email.utils import parseaddr, formataddr from configparser import ConfigParser try: @@ -145,6 +146,9 @@ class Config: logger.info("Your `session-key` has been stored in the " "database itself, this option is now unused") + if not parseaddr(rv.get("smtp", "from"))[0]: + rv.set("smtp", "from", formataddr((u"Ich schrei sonst!", rv.get("smtp", "from")))) + return rv diff --git a/isso/ext/notifications.py b/isso/ext/notifications.py index ea1da63..cdddcea 100644 --- a/isso/ext/notifications.py +++ b/isso/ext/notifications.py @@ -125,7 +125,7 @@ class SMTP(object): to_addr = self.conf.get("to") msg = MIMEText(body, 'plain', 'utf-8') - msg['From'] = "Ich schrei sonst! <%s>" % from_addr + msg['From'] = from_addr msg['To'] = to_addr msg['Date'] = formatdate(localtime=True) msg['Subject'] = Header(subject, 'utf-8')