+2004-04-16 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * spam.el (spam-summary-prepare-exit): simplified logic
+ (spam-fetch-article-header): read the article header if it's not
+ available
+ (spam-list-articles): simplified logic
+ (spam-filelist-register-routine): found bug with unregister-list
+
+ * gnus-registry.el: clarified comments at beginning
+
+2004-04-16 Jesper Harder <harder@ifa.au.dk>
+
+ * message.el (message-cater-to-broken-inn): Remove.
+ (message-shorten-references): Make the total folded length of
+ References is shorter than 998 characters to cater to a bug in INN
+ 2.3. Also, don't pretend that references aren't folded -- this
+ hasn't worked for a while.
+
2004-04-15 Kevin Greiner <kgreiner@xpediantsolutions.com>
* gnus-agent.el (gnus-agentize):
;;; Commentary:
-;; This is the gnus-registry.el package, works with other backends
-;; besides nnmail. The major issue is that it doesn't go across
-;; backends, so for instance if an article is in nnml:sys and you see
-;; a reference to it in nnimap splitting, the article will end up in
-;; nnimap:sys
+;; This is the gnus-registry.el package, which works with all
+;; backends, not just nnmail (e.g. NNTP). The major issue is that it
+;; doesn't go across backends, so for instance if an article is in
+;; nnml:sys and you see a reference to it in nnimap splitting, the
+;; article will end up in nnimap:sys
;; gnus-registry.el intercepts article respooling, moving, deleting,
;; and copying for all backends. If it doesn't work correctly for
:type '(choice (function)
(repeat string)))
-(defvar message-cater-to-broken-inn t
- "Non-nil means Gnus should not fold the `References' header.
-Folding `References' makes ancient versions of INN create incorrect
-NOV lines.")
-
(eval-when-compile
(defvar gnus-post-method)
(defvar gnus-select-method))
(defun message-shorten-references (header references)
"Trim REFERENCES to be 21 Message-ID long or less, and fold them.
-If folding is disallowed, also check that the REFERENCES are less
-than 988 characters long, and if they are not, trim them until they are."
+When sending via news, also check that the REFERENCES are less
+than 988 characters long, and if they are not, trim them until
+they are."
(let ((maxcount 21)
(count 0)
(cut 2)
(message-shorten-1 refs cut surplus)
(decf count surplus)))
- ;; If folding is disallowed, make sure the total length (including
- ;; the spaces between) will be less than MAXSIZE characters.
+ ;; When sending via news, make sure the total folded length will
+ ;; be less than 998 characters. This is to cater to broken INN
+ ;; 2.3 which counts the total number of characters in a header
+ ;; rather than the physical line length of each line, as it shuld.
;;
- ;; Only disallow folding for News messages. At this point the headers
- ;; have not been generated, thus we use message-this-is-news directly.
- (when (and message-this-is-news message-cater-to-broken-inn)
- (let ((maxsize 988)
- (totalsize (+ (apply #'+ (mapcar #'length refs))
- (1- count)))
- (surplus 0)
- (ptr (nthcdr (1- cut) refs)))
- ;; Decide how many elements to cut off...
- (while (> totalsize maxsize)
- (decf totalsize (1+ (length (car ptr))))
- (incf surplus)
- (setq ptr (cdr ptr)))
- ;; ...and do it.
- (when (> surplus 0)
- (message-shorten-1 refs cut surplus))))
-
+ ;; This hack should be removed when it's believed than INN 2.3 is
+ ;; no longer widely used.
+ ;;
+ ;; At this point the headers have not been generated, thus we use
+ ;; message-this-is-news directly.
+ (when message-this-is-news
+ (while (< 998
+ (with-temp-buffer
+ (message-fill-header header (mapconcat #'identity refs " "))
+ (buffer-size)))
+ (message-shorten-1 refs cut 1)))
;; Finally, collect the references back into a string and insert
;; it into the buffer.
- (let ((refstring (mapconcat #'identity refs " ")))
- (if (and message-this-is-news message-cater-to-broken-inn)
- (insert (capitalize (symbol-name header)) ": "
- refstring "\n")
- (message-fill-header header refstring)))))
+ (message-fill-header header (mapconcat #'identity refs " "))))
(defun message-position-point ()
"Move point to where the user probably wants to find it."
(spam-group-processor-p gnus-newsgroup-name processor))
(spam-register-routine classification check))))
- (if spam-move-spam-nonspam-groups-only
- (when (not (spam-group-spam-contents-p gnus-newsgroup-name))
- (spam-mark-spam-as-expired-and-move-routine
- (gnus-parameter-spam-process-destination gnus-newsgroup-name)))
+ (unless (and spam-move-spam-nonspam-groups-only
+ (not (spam-group-spam-contents-p gnus-newsgroup-name)))
(gnus-message 5 "Marking spam as expired and moving it to %s"
gnus-newsgroup-name)
(spam-mark-spam-as-expired-and-move-routine
(defun spam-fetch-article-header (article)
(save-excursion
(set-buffer gnus-summary-buffer)
+ (gnus-read-header article)
(nth 3 (assq article gnus-newsgroup-data))))
\f
(let ((mark-check (if (eq classification 'spam)
'spam-group-spam-mark-p
'spam-group-ham-mark-p))
- list mark-cache-yes mark-cache-no)
+ alist mark-cache-yes mark-cache-no)
(dolist (article articles)
(let ((mark (gnus-summary-article-mark article)))
- (unless (memq mark mark-cache-no)
- (if (memq mark mark-cache-yes)
- (push article list)
- ;; else, we have to actually check the mark
- (if (funcall mark-check
- gnus-newsgroup-name
- mark)
- (progn
- (push article list)
- (push mark mark-cache-yes))
- (push mark mark-cache-no))))))
- list))
+ (unless (or (memq mark mark-cache-yes)
+ (memq mark mark-cache-no))
+ (if (funcall mark-check
+ gnus-newsgroup-name
+ mark)
+ (push mark mark-cache-yes)
+ (push mark mark-cache-no)))
+ (when (memq mark mark-cache-yes)
+ (push article alist))))
+ alist))
(defun spam-register-routine (classification
check
(if blacklist 'spam-enter-blacklist 'spam-enter-whitelist))
(remove-function
(if blacklist 'spam-enter-whitelist 'spam-enter-blacklist))
- from addresses unregister-list)
+ from addresses unregister-list article-unregister-list)
(dolist (article articles)
(let ((from (spam-fetch-field-from-fast article))
(id (spam-fetch-field-message-id-fast article))
(null unregister)
(spam-log-unregistration-needed-p
id 'process declassification de-symbol))
+ (push article article-unregister-list)
(push from unregister-list))
(unless sender-ignored
(push from addresses)))))
(funcall enter-function addresses t) ; unregister all these addresses
;; else, register normally and unregister what we need to
(funcall remove-function unregister-list t)
- (dolist (article unregister-list)
+ (dolist (article article-unregister-list)
(spam-log-undo-registration
(spam-fetch-field-message-id-fast article)
'process