diff --git a/email2post.py b/email2post.py index ca5be26..1865acd 100755 --- a/email2post.py +++ b/email2post.py @@ -62,11 +62,18 @@ def parse(data, pnut, mstdn): msg.append(line) body = '\n'.join(msg) + deltac = data.get('Chat-Version') + if deltac is None: + subject = data['Subject'] + else: + logger.debug(f"Chat-Version: {deltac}") + subject = "" + if pnut: - post_pnut(data['Subject'], body, attachments) + post_pnut(subject, body, attachments) if mstdn: - post_mastodon(data['Subject'], body, attachments) + post_mastodon(subject, body, attachments) def post_pnut(title, text, attachments): post = {'text': text, 'raw': []}