summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-12-08 13:01:13 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2023-12-08 13:01:13 +0100
commita00292129478a2b38673fd39cd361c7142166d4d (patch)
tree739ee64df9acc249f7a1efcd9c3ba1f31726ff30
parentd08bc4fd1dab191db5ee01e81509c9b9b33c710d (diff)
get header fields as optional
-rw-r--r--src/jwebmail/__init__.py2
-rw-r--r--src/jwebmail/model/read_mails.py2
-rw-r--r--src/jwebmail/render_mail.py8
3 files changed, 6 insertions, 6 deletions
diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py
index 665d85c..c8be663 100644
--- a/src/jwebmail/__init__.py
+++ b/src/jwebmail/__init__.py
@@ -35,7 +35,7 @@ else:
toml_read_file = dict(load=toml_load, text=True)
-__version__ = "2.0.0.dev4"
+__version__ = "2.0.0.dev5"
def validate_config(app):
diff --git a/src/jwebmail/model/read_mails.py b/src/jwebmail/model/read_mails.py
index ccd9bb9..b322a16 100644
--- a/src/jwebmail/model/read_mails.py
+++ b/src/jwebmail/model/read_mails.py
@@ -27,9 +27,9 @@ class QMailAuthuser:
try:
completed_proc = subprocess_run(
f"{self._authenticator} true 3<&0",
+ input=f"{self._username}\0{self._password}\0\0".encode(),
shell=True,
timeout=2,
- input=f"{self._username}\0{self._password}\0\0".encode(),
)
if completed_proc.returncode == 0:
return True
diff --git a/src/jwebmail/render_mail.py b/src/jwebmail/render_mail.py
index 804b200..588959c 100644
--- a/src/jwebmail/render_mail.py
+++ b/src/jwebmail/render_mail.py
@@ -114,10 +114,10 @@ def render_message(subtype, msg, path):
R += '<dl class="jwm-mail-header">'
R += f"<dt>{escape(gettext('Subject'))}</dt>"
R += f"<dd>{escape(msg['head']['subject'])}</dd>\n"
- R += _format_header(gettext("From"), msg["head"]["from"])
- R += _format_header(gettext("To"), msg["head"]["to"])
- R += _format_header(gettext("CC"), msg["head"]["cc"])
- R += _format_header(gettext("BCC"), msg["head"]["bcc"])
+ R += _format_header(gettext("From"), msg["head"].get("from"))
+ R += _format_header(gettext("To"), msg["head"].get("to"))
+ R += _format_header(gettext("CC"), msg["head"].get("cc"))
+ R += _format_header(gettext("BCC"), msg["head"].get("bcc"))
R += f"<dt>{escape(gettext('Date'))}</dt>"
R += f"<dd>{escape(msg['head']['date'])}</dd>\n"
R += f"<dt>{escape(gettext('Content-Type'))}</dt>"