From 2ae121e400149261c8822a0146c11f937e51917c Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Wed, 22 Nov 2023 21:51:04 +0100 Subject: [PATCH] work around bug in microsoft outlook "new", which fails when the tag in an esearch response doesn't have quotes --- imapserver/search.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imapserver/search.go b/imapserver/search.go index bb96363..0591ae2 100644 --- a/imapserver/search.go +++ b/imapserver/search.go @@ -221,7 +221,9 @@ func (c *conn) cmdxSearch(isUID bool, tag, cmd string, p *parser) { // No untagged ESEARCH response if nothing was requested. ../rfc/9051:4160 if len(eargs) > 0 { - resp := fmt.Sprintf("* ESEARCH (TAG %s)", tag) + // Microsoft Outlook "new" (Microsoft Office 365/15.20.7025.17) seems to fail when + // the tag value doesn't have double quotes. These quotes are optional. + resp := fmt.Sprintf(`* ESEARCH (TAG "%s")`, tag) if isUID { resp += " UID" }