Archived
1
0

fix sa hook

This commit is contained in:
Jeff Becker 2017-11-07 14:16:23 -05:00
parent 96a931de3e
commit 2195c0a29c
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
2 changed files with 2 additions and 7 deletions

View File

@ -851,7 +851,7 @@ func (self *NNTPDaemon) poll(worker int) {
if hdr == nil { if hdr == nil {
log.Println("worker", worker, "failed to load", msgid) log.Println("worker", worker, "failed to load", msgid)
} else { } else {
msgid := getMessageIDFromArticleHeaders(hdr) msgid := getMessageID(hdr)
log.Println("worker", worker, "got", msgid) log.Println("worker", worker, "got", msgid)
rollover := 100 rollover := 100
group := hdr.Get("Newsgroups", "") group := hdr.Get("Newsgroups", "")

View File

@ -553,17 +553,12 @@ func getMessageID(h map[string][]string) string {
for k := range h { for k := range h {
kl := strings.ToLower(k) kl := strings.ToLower(k)
if kl == "message-id" || kl == "messageid" { if kl == "message-id" || kl == "messageid" {
return h[k][0] return strings.TrimSpace(h[k][0])
} }
} }
return "" return ""
} }
func getMessageIDFromArticleHeaders(hdr ArticleHeaders) (msgid string) {
msgid = hdr.Get("Message-Id", hdr.Get("Message-ID", hdr.Get("message-id", hdr.Get("MESSAGE-ID", ""))))
return
}
func readMIMEHeader(r *bufio.Reader) (msg *mail.Message, err error) { func readMIMEHeader(r *bufio.Reader) (msg *mail.Message, err error) {
msg, err = mail.ReadMessage(r) msg, err = mail.ReadMessage(r)
/* /*