From 6057fefc501cb8116eea029cb1db5fff3734712b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 2 Feb 2014 07:49:07 -0800 Subject: [PATCH] WIP: feed: Add Content-Description to digest parts Copy the message Subject to the MIMEMessage's Content-Description [1,2]. We already set the MIME types for the attachements (with MIMEMessage). Mutt [3] seems to look inside attached message parts and extract their subject as a description, so the current xkcd feed looked like: A 1 Questions for God [message/rfc822, 7bit, 0.6K] A 2 Inexplicable [message/rfc822, 7bit, 0.6K] A 3 Theft [message/rfc822, 7bit, 0.7K] A 4 Actually [message/rfc822, 7bit, 0.7K] However, in the notmuch-show Emacs mode [4] it looked like: xkcd.com: (20 mins. ago) (inbox) Subject: digest for xkcd To: wking@tremily.us Date: Sat, 18 Jan 2014 17:18:20 +0000 [ multipart/digest ] [ message/rfc822 (hidden) ] [ message/rfc822 (hidden) ] [ message/rfc822 (hidden) ] [ message/rfc822 (hidden) ] which is not very informative. With this commit, the Mutt rendering is unchanged, and the notmuch-show-mode rendering is (WIP: unchanged?): xkcd.com: (Today 08:01) (inbox) Subject: digest for xkcd To: wking@tremily.us Date: Sun, 02 Feb 2014 16:01:32 +0000 [ multipart/digest ] [ message/rfc822 (hidden) ] [ message/rfc822 (hidden) ] [ message/rfc822 (hidden) ] [ message/rfc822 (hidden) ] I'll ping the Notmuch list about this... [1]: http://tools.ietf.org/html/rfc2045#section-8 [2]: http://tools.ietf.org/html/rfc2183#section-3 [3]: http://www.mutt.org/ [4]: http://notmuchmail.org/emacstips/ Reported-by: Victor J. Orlikowski Signed-off-by: W. Trevor King --- rss2email/feed.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rss2email/feed.py b/rss2email/feed.py index ef4d770..7df218f 100644 --- a/rss2email/feed.py +++ b/rss2email/feed.py @@ -870,6 +870,7 @@ class Feed (object): def _append_to_digest(self, digest, message): part = _MIMEMessage(message) part.add_header('Content-Disposition', 'attachment') + part['Content-Description'] = message['Subject'] digest.attach(part) def _send_digest(self, digest, seen, sender, send=True): -- 2.26.2