[mew-int 01083] Re: viruses
Tatsuya Kinoshita
tats at example.com
Wed Sep 11 19:37:23 JST 2002
On September 9, 2002, [mew-int 01077],
Tatsuya Kinoshita <tats at example.com> wrote:
> ;;; A sample ~/.mew.el for Mew + SpamAssassin
> (setq mew-scan-form-mark-spam nil) ;; If non-nil, the mark specified by 'mew-mark-spam' is automatically put on spam messages.
> (defadvice mew-scan-form-mark (after mark-spam activate)
> (let (file)
> (if (and mew-scan-form-mark-spam
> (not (string= ad-return-value (char-to-string mew-mark-spam)))
> (mew-which-exec mew-prog-spamc)
> (setq file (mew-expand-folder (MEW-FLD) (MEW-NUM)))
> (file-exists-p file)
> (> (call-process mew-prog-spamc file nil nil "-c")
> 0))
> (setq ad-return-value (char-to-string mew-mark-spam)))))
The mew-scan-form-mark-spam feature is unnecessary on non-inbox
folders. So, I replaced the above defadvice with this:
----
(defadvice mew-scan-form-mark (after mark-spam activate)
(let ((fld (MEW-FLD))
file)
(if (and mew-scan-form-mark-spam
(mew-folder-inboxp fld)
(not (string= ad-return-value (char-to-string mew-mark-spam)))
(mew-which-exec mew-prog-spamc)
(setq file (mew-expand-folder fld (MEW-NUM)))
(file-exists-p file)
(> (call-process mew-prog-spamc file nil nil "-c")
0))
(setq ad-return-value (char-to-string mew-mark-spam)))))
----
If you want to use the mew-scan-form-mark-spam feature on Mew 3's
remote folders, use this:
----
(defadvice mew-scan-form-mark (after mark-spam activate)
(let* ((casefld (MEW-FLD))
(fld (mew-folder-folder casefld))
file)
(if (and mew-scan-form-mark-spam
(or (mew-folder-inboxp fld)
(mew-folder-popp fld)
(string= fld mew-imap-inbox-folder))
(not (string= ad-return-value (char-to-string mew-mark-spam)))
(mew-which-exec mew-prog-spamc)
(setq file (mew-expand-folder casefld (MEW-NUM)))
(file-exists-p file)
(> (call-process mew-prog-spamc file nil nil "-c")
0))
(setq ad-return-value (char-to-string mew-mark-spam)))))
----
(Unfortunately, NNTP remote folder is unsupported. `D' mark is
not permitted on NNTP remote folders.)
--
Tatsuya Kinoshita
More information about the Mew-int
mailing list