From 71399e45af5929f4ff12c4e8ad0d8b07559f0551 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 8 Dec 2024 22:38:01 +0100 Subject: [PATCH] imapserver: add support for RFC822.PEEK This is still used by Outlook: https://learn.microsoft.com/en-us/openspecs/exchange_standards/ms-stanoimap/8e9492b1-b812-4a1a-93ea-4d69489eb5cd Closes: https://github.com/emersion/go-imap/issues/657 --- imapserver/fetch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/imapserver/fetch.go b/imapserver/fetch.go index 73bc625b..abb32f84 100644 --- a/imapserver/fetch.go +++ b/imapserver/fetch.go @@ -112,6 +112,10 @@ func handleFetchAtt(dec *imapwire.Decoder, attName string, options *imap.FetchOp bs := &imap.FetchItemBodySection{} writerOptions.obsolete[bs] = attName options.BodySection = append(options.BodySection, bs) + case "RFC822.PEEK": // obsolete, equivalent to BODY.PEEK[], used by Outlook + bs := &imap.FetchItemBodySection{Peek: true} + writerOptions.obsolete[bs] = attName + options.BodySection = append(options.BodySection, bs) case "RFC822.HEADER": // equivalent to BODY.PEEK[HEADER] bs := &imap.FetchItemBodySection{ Specifier: imap.PartSpecifierHeader,