From: Bastien Guerry <bzg@altern.org>
To: emacs-devel@gnu.org
Cc: Eli Zaretskii <eliz@gnu.org>
Subject: rmail-spam-filter.el: also match
Date: Wed, 13 Feb 2008 01:00:13 +0000 [thread overview]
Message-ID: <87hcgdwu02.fsf@bzg.ath.cx> (raw)
[-- Attachment #1: Type: text/plain, Size: 355 bytes --]
Someone on help-gnu-emacs asked whether RMAIL could check for the
spamassassion spam headers and keep possible spam in a separate
folder for later double-check.
Eli pointed on rmail-spam-filter.el, but currently it doesn't let the
user request a check on the X-Spam-Status header.
The patch below fix this.
If no objection, I will apply it tomorrow.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rmail-spam-filter.el.patch --]
[-- Type: text/x-diff, Size: 1410 bytes --]
--- rmail-spam-filter.el.~1.19.~ 2008-01-08 20:45:08.000000000 +0000
+++ rmail-spam-filter.el 2008-02-13 00:53:32.000000000 +0000
@@ -201,6 +201,9 @@
(cons :format "%v" :value (contents . "")
(const :format "" contents)
(string :tag "Contents" ""))
+ (cons :format "%v" :value (x-spam-status . "")
+ (const :format "" x-spam-status)
+ (string :tag "X-Spam-Status" ""))
(cons :format "%v" :value (action . output-and-delete)
(const :format "" action)
(choice :tag "Action selection"
@@ -284,6 +287,7 @@
(concat ", " (mail-fetch-field "Cc")))))
(setq message-subject (mail-fetch-field "Subject"))
(setq message-content-type (mail-fetch-field "Content-Type"))
+ (setq message-spam-status (mail-fetch-field "X-Spam-Status"))
)
;; Find number of spam-definition elements in the list
;; rsf-definitions-alist specified by user:
@@ -363,6 +367,11 @@
(rmail-msgbeg msg) (rmail-msgend msg))
definition maybe-spam)
+ ;; finally, check the X-Spam-Status header. You will typically
+ ;; look for the "Yes" string in this header field
+ (check-field 'x-spam-status message-spam-status
+ definition maybe-spam)
+
;; if the search in rsf-definitions-alist found
;; that this email is spam, output the email to the spam
;; rmail file, mark the email for deletion, leave the
[-- Attachment #3: Type: text/plain, Size: 13 bytes --]
--
Bastien
next reply other threads:[~2008-02-13 1:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-13 1:00 Bastien Guerry [this message]
2008-02-13 22:01 ` rmail-spam-filter.el: also match Richard Stallman
2008-02-13 22:11 ` Bastien Guerry
2008-02-14 18:11 ` Richard Stallman
2008-02-13 22:07 ` Bastien Guerry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hcgdwu02.fsf@bzg.ath.cx \
--to=bzg@altern.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.