aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/mail.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/feed/mail.go')
-rw-r--r--internal/feed/mail.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/feed/mail.go b/internal/feed/mail.go
index 4b0e38b..ebf032a 100644
--- a/internal/feed/mail.go
+++ b/internal/feed/mail.go
@@ -49,8 +49,9 @@ func buildHeader(feed *Feed, item feeditem, cfg *config.Config) message.Header {
h.SetContentType("multipart/alternative", nil)
h.SetAddressList("From", fromAdress(feed, item, cfg))
h.SetAddressList("To", address(feed.Name, cfg.DefaultEmail))
- h.Add("X-Feed2Imap-Version", config.Version())
- h.Add("X-Feed2Imap-Reason", strings.Join(item.reasons, ","))
+ h.Set("X-Feed2Imap-Version", config.Version())
+ h.Set("X-Feed2Imap-Reason", strings.Join(item.reasons, ","))
+ h.Set("Message-Id", feed.messageId(item))
{ // date
date := item.Item.PublishedParsed
@@ -227,6 +228,10 @@ func getBody(content, description string, bodyCfg config.Body) string {
}
}
+func (feed *Feed) messageId(item feeditem) string {
+ return fmt.Sprintf("<feed#%s#%s@%s>", feed.cached.ID(), item.itemId, config.Hostname())
+}
+
func (feed *Feed) buildBody(item *feeditem) {
body := getBody(item.Item.Content, item.Item.Description, feed.Body)