- (sender (spam-fetch-field-from-fast article)))
- (unless (and spam-log-to-registry
- (spam-log-registered-p id 'incoming))
- (let* ((spam-split-symbolic-return t)
- (spam-split-symbolic-return-positive t)
- (split-return
- (with-temp-buffer
- (gnus-request-article-this-buffer
- article
- group)
- (if (or (null first-method)
- (equal first-method 'default))
- (spam-split)
- (apply 'spam-split methods)))))
- (if (equal split-return 'spam)
- (gnus-summary-mark-article article gnus-spam-mark))
-
- (when (and split-return spam-log-to-registry)
- (when (zerop (gnus-registry-group-count id))
- (gnus-registry-add-group
- id group subject sender))
+ (sender (spam-fetch-field-from-fast article))
+ registry-lookup)
+
+ (unless id
+ (gnus-error 5 "Article %d has no message ID!" article))
+
+ (when (and id spam-log-to-registry)
+ (setq registry-lookup (spam-log-registration-type id 'incoming))
+ (when registry-lookup
+ (gnus-message
+ 9
+ "spam-find-spam: message %s was already registered incoming"
+ id)))
+
+ (let* ((spam-split-symbolic-return t)
+ (spam-split-symbolic-return-positive t)
+ (split-return
+ (or registry-lookup
+ (with-temp-buffer
+ (if article-cannot-be-faked
+ (gnus-request-article-this-buffer
+ article
+ group)
+ (spam-insert-fake-headers article))
+ (if (or (null first-method)
+ (equal first-method 'default))
+ (spam-split)
+ (apply 'spam-split methods))))))
+ (if (equal split-return 'spam)
+ (gnus-summary-mark-article article gnus-spam-mark))
+
+ (when (and id split-return spam-log-to-registry)
+ (when (zerop (gnus-registry-group-count id))
+ (gnus-registry-add-group
+ id group subject sender))