>>>>> "Nix" == Nix  <[EMAIL PROTECTED]> writes:

 Nix> On 4 Feb 2008, Don Saklad said:
 >> For RMAIL in EMACS how do you setup a file of the spam messages?...

 Nix> I suspect that RMS is the only other rmail user left on Earth. You
 Nix> could try asking him :)

Not so.  I am an emacs user from years back, and use RMAIL/Babyl
format.  I have an extensive mail filter written in Lisp, linked into
mail reading with
(add-hook 'rmail-show-message-hook 'rmail-file-filtering-mail-hook)

and the filter starts

(defun rmail-file-filtering-mail-hook () 
  "Hook to file mail and label spam etc automatically"
  (if (eq (current-buffer)
          (get-file-buffer (expand-file-name "~/RMAIL")))
                                        ; Only for RMAIL file
      (let
          (pos subject to cc sender reply from content-type x-sa x-rbl
               x-sas x-bar x-mailer x-message-info x-warning return-path 
received)
        (save-restriction
          (rmail-narrow-to-non-pruned-header)
          (setq pos (point))
          (setq subject (mail-fetch-field "Subject"))
          (setq to      (mail-fetch-field "To"))
          (setq cc      (mail-fetch-field "Cc"))
          (setq sender  (mail-fetch-field "Sender"))
          (setq reply   (mail-fetch-field "Reply-to"))
          (setq from    (mail-fetch-field "From"))
          (setq x-sa    (mail-fetch-field "X-Spam-Flag"))
          (setq x-sas   (mail-fetch-field "X-Spam-Score"))
          (setq x-bar   (mail-fetch-field "X-Spam_bar"))
          (setq x-mailer (mail-fetch-field "X-Mailer"))
          (setq x-message-info (mail-fetch-field "X-Message-Info"))
          (setq x-warning (mail-fetch-field "X-Warning"))
          (setq x-rbl   (mail-fetch-field "X-RBL-Warning"))
          (setq return-path (mail-fetch-field "Return-path"))
          (setq content-type (mail-fetch-field "Content-Type"))
          )
        (goto-char pos)
        (if (eq subject nil) (setq subject ""))
        (if (eq to nil)      (setq to ""))
        (if (eq cc nil)      (setq cc ""))
        (if (eq sender nil)  (setq sender ""))
        (if (eq reply nil)   (setq reply ""))
        (if (eq from nil)    (setq from ""))
        (if (eq x-warning nil) (setq x-warning ""))
        (if (eq x-sa nil)    (setq x-sa ""))
        (if (eq x-sas nil)   (setq x-sas ""))
        (if (eq x-bar nil)   (setq x-bar ""))
        (if (eq x-mailer nil) (setq x-mailer ""))
        (if (eq x-rbl nil)   (setq x-rbl ""))
        (if (eq return-path nil) (setq return-path ""))
        (if (eq received nil) (setq received ""))
        (if (eq content-type nil)    (setq content-type ""))
        (cond ((string-match "text/html" content-type)
               (let ((ss rmail-delete-after-output))
                 (setq rmail-delete-after-output nil)
                 (rmail-set-label "html-mail" t)
                 (rmail-output-to-rmail-file
                  (expand-file-name "~/Junky"))
                 (rmail-set-attribute "deleted" t)
                 (let ((del-msg rmail-current-message))
                   (if (rmail-summary-exists)
                       (rmail-select-summary
                        (rmail-summary-mark-deleted del-msg))))
                 (setq rmail-delete-after-output ss)
                 (rmail-next-undeleted-message 1)))
              ((rmail-message-labels-p rmail-current-message "white") nil)
              ((rmail-message-deleted-p rmail-current-message) nil)
              ((rmail-message-labels-p rmail-current-message "filed") nil)
;; things that have been mislabelled first
and so on for a long time; recogmises mailing list, odd friends etc
etc.  If it is of any use just mail me. I have run this for most of
a decade now. and it gets tweaked from time to time.

Do you mean there are other systems for reading mail?  Never seen one
to touch RMAIL.

==John ffitch

Reply via email to