- (buffer (nnheader-set-temp-buffer " *Gnus NoCeM*"))
- headers)
- (setq headers
- (if (eq 'nov
- (gnus-retrieve-headers
- (setq articles
- (gnus-uncompress-range
- (cons
- (if active (1+ (cdr active))
- (car gactive))
- (cdr gactive))))
- group))
- (gnus-get-newsgroup-headers-xover
- articles nil dependencies)
- (gnus-get-newsgroup-headers dependencies)))
- (while headers
- ;; We take a closer look on all articles that have
- ;; "@@NCM" in the subject.
- (when (string-match "@@NCM"
- (mail-header-subject (car headers)))
- (gnus-nocem-check-article group (car headers)))
- (setq headers (cdr headers)))
- (kill-buffer (current-buffer)))))
+ headers header)
+ (with-temp-buffer
+ (setq headers
+ (if (eq 'nov
+ (gnus-retrieve-headers
+ (setq articles
+ (gnus-uncompress-range
+ (cons
+ (if active (1+ (cdr active))
+ (car gactive))
+ (cdr gactive))))
+ group))
+ (gnus-get-newsgroup-headers-xover
+ articles nil dependencies)
+ (gnus-get-newsgroup-headers dependencies)))
+ (while (setq header (pop headers))
+ ;; We take a closer look on all articles that have
+ ;; "@@NCM" in the subject. Unless we already read
+ ;; this cross posted message. Nocem messages
+ ;; are not allowed to have references, so we can
+ ;; ignore scanning followups.
+ (and (string-match "@@NCM" (mail-header-subject header))
+ (and gnus-nocem-check-from
+ (let ((case-fold-search t))
+ (catch 'ok
+ (mapc
+ (lambda (author)
+ (if (consp author)
+ (setq author (car author)))
+ (if (string-match
+ author (mail-header-from header))
+ (throw 'ok t)))
+ gnus-nocem-issuers)
+ nil)))
+ (or gnus-nocem-liberal-fetch
+ (and (or (string= "" (mail-header-references
+ header))
+ (null (mail-header-references header)))
+ (not (member (mail-header-message-id header)
+ gnus-nocem-seen-message-ids))))
+ (push header check-headers)))
+ (setq check-headers (last (nreverse check-headers)
+ gnus-nocem-check-article-limit))
+ (let ((i 0)
+ (len (length check-headers)))
+ (dolist (h check-headers)
+ (gnus-message
+ 7 "Checking article %d in %s for NoCeM (%d of %d)..."
+ (mail-header-number h) group (incf i) len)
+ (gnus-nocem-check-article group h)))))))