Function: rsf-add-content-type-field

rsf-add-content-type-field is an interactive and byte-compiled function defined in rmail-spam-filter.el.gz.

Signature

(rsf-add-content-type-field)

Documentation

Maintain backward compatibility for rmail-spam-filter.

The most recent version of rmail-spam-filter checks the content-type field of the incoming mail to see if it is spam. The format of rsf-definitions-alist has therefore changed. This function checks to see if the old format is used, and updates it if necessary.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rmail-spam-filter.el.gz
(defun rsf-add-content-type-field ()
  "Maintain backward compatibility for `rmail-spam-filter'.
The most recent version of `rmail-spam-filter' checks the content-type
field of the incoming mail to see if it is spam.  The format of
`rsf-definitions-alist' has therefore changed.  This function
checks to see if the old format is used, and updates it if necessary."
  (interactive)
  (if (and rsf-definitions-alist
           (not (assoc 'content-type (car rsf-definitions-alist))))
      (let ((result nil)
            (current nil)
            (definitions rsf-definitions-alist))
        (while definitions
          (setq current (car definitions))
          (setq definitions (cdr definitions))
          (setq result
                (append result
                        (list
                         (list (assoc 'from current)
                               (assoc 'to current)
                               (assoc 'subject current)
                               (cons 'content-type "")
                               (assoc 'contents current)
                               (assoc 'action current))))))
        (setq rsf-definitions-alist result)
        (customize-mark-to-save 'rsf-definitions-alist)
        (if rsf-autosave-newly-added-definitions
            (progn
              (custom-save-all)
              (message "Spam definitions converted to new format, and saved"))
          (message "Spam definitions converted to new format (remember to save)")))))