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: Christian Lynbech
Subject: Re: Fight spam with BBDB database?
Date: Fri, 28 May 2004 09:29:52 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Here is what I have for this in my .gnus. I am not sure that this
really is the best for querying bbdb about known senders but it seems
to work for me.

(setq my-split-rules
      '(("INBOX.lists.cmucl"   "^[A-Za-z-]+: .*cmucl[^@]*@cons.org")
        ("INBOX.lists.wsmith"  "^From: Wordsmith")
        ("INBOX.lists.auctex"  "^\\(To\\|CC\\): .*auc-?tex")
        ("INBOX.lists.ilisp"   "ilisp@cons.org")
        ("INBOX.lists.clisp"   "clisp.*@lists.sourceforge.net")
        ("INBOX.lists.clim"    "free-clim.*@\\(cons.org\\|mikemac.com\\)")
        ("INBOX.lists.sbcl"    "sbcl.*@lists\\.sourceforge\\.net")
        ("INBOX.lists.eclipse" "eclipse.*@common-lisp\\.net")
        ("INBOX.lists.slime"   "slime.*@common-lisp\\.net")
        ("INBOX.lists.cells"   "cells.*@common-lisp\\.net")
        ("INBOX.lists.opensource" "opensource@franz\\.com")
        ("INBOX.lists.openmcl" "openmcl.*@clozure\\.com")
        ("INBOX.lists.gbbopen" "gbbopen.*@gbbopen\\.org")
        ("INBOX.personal"      my-check-author-against-bbdb)
        ("INBOX.misc"          ""))

      nnimap-split-rule my-split-rules)

(defun my-check-author-against-bbdb (&rest args)
  "Check sender against BBDB.
This function receives the target INBOX as argument but ignores it."
  (message "calling my-check-author-against-bbdb...")
  (and (or (re-search-forward
            "From: .*[ <(]\\([a-zA-Z0-9.]+@[a-zA-Z0-9.]+\\).*$" nil t)
           (re-search-forward
            "From:\\s-*\\([a-zA-Z0-9.]+@[a-zA-Z0-9.]+\\).*$" nil t))
       (progn (message "found name '%s'" (match-string-no-properties 1)) t)
       (fboundp 'bbdb/vm-alternate-full-name)
       (bbdb/vm-alternate-full-name (match-string-no-properties 1))))


------------------------+-----------------------------------------------------
Christian Lynbech       | christian #\@ defun #\. dk
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)


reply via email to

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