Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
92ef96ee
Commit
92ef96ee
authored
Feb 19, 2009
by
Glenn Morris
Browse files
(rmail-get-new-mail-filter-spam): Move here from rmail.el.
parent
e73521d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
lisp/mail/rmail-spam-filter.el
lisp/mail/rmail-spam-filter.el
+24
-0
No files found.
lisp/mail/rmail-spam-filter.el
View file @
92ef96ee
...
...
@@ -351,6 +351,30 @@ it from rmail file. Called for each new message retrieved by
(
setq
return-value
t
)))
return-value
))
(
defun
rmail-get-new-mail-filter-spam
(
nnew
)
"Check the most NNEW recent messages for spam."
(
let*
((
nold
(
-
rmail-total-messages
nnew
))
(
nspam
0
)
(
nscan
(
1+
nold
)))
(
while
(
<=
nscan
rmail-total-messages
)
(
or
(
rmail-spam-filter
nscan
)
(
setq
nspam
(
1+
nspam
)))
(
setq
nscan
(
1+
nscan
)))
(
when
(
>
nspam
0
)
;; Otherwise the expunge prompt leaves the raw mbox buffer showing.
(
rmail-show-message
(
rmail-first-unseen-message
)
1
)
(
if
(
rmail-expunge-confirmed
)
(
rmail-only-expunge
t
))
;; Swap back, else get-new-mail-1 gets confused.
(
rmail-swap-buffers-maybe
)
(
widen
))
;; Return a message based on the number of spam messages found.
(
cond
((
zerop
nspam
)
""
)
((
=
1
nnew
)
", and it appears to be spam"
)
((
=
nspam
nnew
)
", and all appear to be spam"
)
(
t
(
format
", and %d appear%s to be spam"
nspam
(
if
(
=
1
nspam
)
"s"
""
))))))
;; define functions for interactively adding sender/subject of a
;; specific message to the spam definitions while reading it, using
;; the menubar:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment