From a00292129478a2b38673fd39cd361c7142166d4d Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Fri, 8 Dec 2023 13:01:13 +0100 Subject: get header fields as optional --- src/jwebmail/render_mail.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/jwebmail/render_mail.py') 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 += '
' R += f"
{escape(gettext('Subject'))}
" R += f"
{escape(msg['head']['subject'])}
\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"
{escape(gettext('Date'))}
" R += f"
{escape(msg['head']['date'])}
\n" R += f"
{escape(gettext('Content-Type'))}
" -- cgit v1.2.3