fix sa hook
This commit is contained in:
parent
96a931de3e
commit
2195c0a29c
@ -851,7 +851,7 @@ func (self *NNTPDaemon) poll(worker int) {
|
||||
if hdr == nil {
|
||||
log.Println("worker", worker, "failed to load", msgid)
|
||||
} else {
|
||||
msgid := getMessageIDFromArticleHeaders(hdr)
|
||||
msgid := getMessageID(hdr)
|
||||
log.Println("worker", worker, "got", msgid)
|
||||
rollover := 100
|
||||
group := hdr.Get("Newsgroups", "")
|
||||
|
@ -553,17 +553,12 @@ 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]
|
||||
return strings.TrimSpace(h[k][0])
|
||||
}
|
||||
}
|
||||
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) {
|
||||
msg, err = mail.ReadMessage(r)
|
||||
/*
|
||||
|
Reference in New Issue
Block a user