aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/mail.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-02 18:51:37 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-02 18:51:37 +0200
commit477241a2c2356c61b7317246040aee50d2a7a81d (patch)
tree56a040ab9c938d71455366ade90d1c5443440d32 /internal/feed/mail.go
parentc05a640571b57bd63e67867f9d8122c4e2d1d183 (diff)
downloadfeed2imap-go-477241a2c2356c61b7317246040aee50d2a7a81d.tar.gz
feed2imap-go-477241a2c2356c61b7317246040aee50d2a7a81d.tar.bz2
feed2imap-go-477241a2c2356c61b7317246040aee50d2a7a81d.zip
WIP: Message-Ids
Diffstat (limited to '')
-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)