From e7c610069125e284d76084fb2285ff7a843f3ebb Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 6 Nov 2017 18:32:39 -0500 Subject: [PATCH] blurrrrr --- contrib/backends/srndv2/src/srnd/util.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/util.go b/contrib/backends/srndv2/src/srnd/util.go index 21524bc..476e934 100644 --- a/contrib/backends/srndv2/src/srnd/util.go +++ b/contrib/backends/srndv2/src/srnd/util.go @@ -549,19 +549,14 @@ func getGroupForCatalog(file string) (group string) { // get a message id from a mime header // checks many values -func getMessageID(h map[string][]string) (msgid string) { - hdr := textproto.MIMEHeader(h) - msgid = hdr.Get("Message-Id") - if msgid == "" { - msgid = hdr.Get("Message-ID") +func getMessageID(h map[string][]string) string { + for k := range h { + kl := strings.ToLower(k) + if kl == "message-id" || kl == "messageid" { + return h[k][0] + } } - if msgid == "" { - msgid = hdr.Get("message-id") - } - if msgid == "" { - msgid = hdr.Get("MESSAGE-ID") - } - return + return "" } func getMessageIDFromArticleHeaders(hdr ArticleHeaders) (msgid string) {