aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-08-22 13:42:58 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-08-22 13:42:58 +0200
commiteb2b7b872bf70343e6f15c8cbd6ed0fc3e6bfaa7 (patch)
treecd11f50730bcdcfbafcf66177defd43a1f7d4293
parent5bb69146dae7f0d7af0ade29c5b6f9b13bd3fbaf (diff)
downloadfeed2imap-go-eb2b7b872bf70343e6f15c8cbd6ed0fc3e6bfaa7.tar.gz
feed2imap-go-eb2b7b872bf70343e6f15c8cbd6ed0fc3e6bfaa7.tar.bz2
feed2imap-go-eb2b7b872bf70343e6f15c8cbd6ed0fc3e6bfaa7.zip
Add creation timestamp as header
-rw-r--r--internal/feed/mail.go1
-rw-r--r--internal/msg/msg.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/internal/feed/mail.go b/internal/feed/mail.go
index 55cb569..b778ee3 100644
--- a/internal/feed/mail.go
+++ b/internal/feed/mail.go
@@ -58,6 +58,7 @@ func (item *item) buildHeader() message.Header {
h.Set(msg.VersionHeader, version.Version())
h.Set(msg.ReasonHeader, strings.Join(item.reasons, ","))
h.Set(msg.IdHeader, item.id())
+ h.Set(msg.CreateHeader, time.Now().Format(time.RFC1123Z))
if item.GUID != "" {
h.Set(msg.GuidHeader, item.GUID)
}
diff --git a/internal/msg/msg.go b/internal/msg/msg.go
index a742a9d..c96bc6c 100644
--- a/internal/msg/msg.go
+++ b/internal/msg/msg.go
@@ -13,6 +13,7 @@ const (
ReasonHeader = "X-Feed2Imap-Reason"
IdHeader = "X-Feed2Imap-Item"
GuidHeader = "X-Feed2Imap-Guid"
+ CreateHeader = "X-Feed2Imap-Create-Date"
)
type Messages []Message