info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fight spam with BBDB database?


From: Peter Gjefle
Subject: Re: Fight spam with BBDB database?
Date: 27 May 2004 02:34:29 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

* Richard Wellum (2004 May 26, 14:15)
> Could I filter all
> email from users not in my BBDB database into a SPAM folder? 

i used that approach for some years. my boxes where

 mail.me        - only to me
 mail.public    - known senders
 mail.stranger  - spam..

from my .emacs

(setq nnmail-crosspost nil) ; the first match found will be used
(setq nnmail-split-methods 'nnmail-split-fancy)
(setq nnmail-split-fancy
      '(|
        (from "\\(MAILER-DAEMON\\|postmaster\\)@.*" "mail.me")
        ("Content-Type" "Windows-1251" "mail.stranger")
        ("Content-Type" "koi8-r" "mail.stranger")
        (to ".*\\(swy\\|cisv\\).*" "mail.public") ; mailing lists
;; (2001) John Wiegley <johnw*gnu.org>
;; finding spam (i.e., mail from people not in my BBDB)
        (:
         (lambda nil
           (let
               ((subject
                 (message-fetch-field "Subject"))
                (references
                 (message-fetch-field "References"))
                (from
                 (message-fetch-field "From")))
             (unless
                 (or references
                     (and subject
                          (string-match 
;;                         my case-fold is t
                           "\\(oslo\\|nhh\\)" subject)) ; "pass words"
                     (and from
                          (apply 'bbdb-search-simple
                                 (mail-extract-address-components from))))
               "mail.stranger"))))
;; 
        (to ".*,.*" "mail.public")
        ("to" "peter@gjefle" "mail.me")
        ("to" "peter.gjefle" "mail.me")
;;      default group matches everything not caught above
        "mail.public"))


now i use imap and procmail. i would love to find a recipe which could
do the same as above in procmail. i've seen recipes using a whitelist,
but i would like it to read the actual .bbdb, pointers anyone?

thanks to John Wiegley for the above code!
-- 
                                               __o     (+47) 8124 0000
                                             _`\<,_   peter gjefle com
 ...  peter gjefle - norway  .............. (_)/'(_) ...................
 .. removing "04." from my reply address increases priority to normal ..


reply via email to

[Prev in Thread] Current Thread [Next in Thread]