Gnus development mailing list
 help / color / mirror / Atom feed
From: Cezar <cezar@mixandgo.ro>
To: ding@gnus.org
Subject: spam filtering setup
Date: Sun, 09 Sep 2007 12:31:45 +0300	[thread overview]
Message-ID: <878x7gxjzy.fsf@myhost.localdomain> (raw)


Hello,

  I have read the manual a few times by now but I still can't make my
gnus filter spam and I don't know what am I doing wrong.

  The problem is I still get a lot of spam and think filtering doesn't
actually happen.

  I am using emacs from cvs and gnus 5.11.

  Here is my .gnus.el :

(require 'bbdb)
(bbdb-initialize 'gnus 'message)
(add-hook 'message-setup-hook 'bbdb-define-all-aliases)
(setq gnus-select-method '(nntp "news.gmane.org"))
(add-to-list 'gnus-secondary-select-methods '(nntp "news.readfreenews.net"))
(add-to-list 'gnus-secondary-select-methods '(nnml "private"))

(setq mail-sources
      '((file :path "/var/mail/cezar")
        (maildir :path "/home/cezar/.maildir")))

(require 'spam)
(spam-initialize)
(setq spam-use-bogofilter t)
(setq gnus-install-group-spam-parameters nil)
(setq gnus-spam-process-newsgroups
      '(("nnml:.*" (gnus-group-spam-exit-processor-bogofilter
                    gnus-group-ham-exit-processor-bogofilter)))
      gnus-spam-process-destinations '(("nnml:.*" "nnml:spambox"))
      gnus-ham-process-destinations '(("nnml:spambox" "nnml:reclassify"))
      spam-junk-mailgroups '("nnml:spambox")
      spam-split-group "nnml:spambox")

(setq nnmail-split-methods 'nnmail-split-fancy)
(setq nnmail-split-fancy
  '(|
    ("subject" ".*SECURITY" "WebSecurity")
    ("subject" ".*Webappsec" "WebSecurity")
    ("subject" ".*WSG" "WebStandards")
    (: spam-split)
    (to "me@mydomain.com" "Personal")
    (from ".*@mydomain.com" "Personal")  ;; from work
    "mail.other"))

(setq gnus-visible-headers
      '("^From" "^Subject" "^Date" "^Newsgroups" "^Followup-To"
        "^User-Agent" "^X-Newsreader" "^X-Mailer"))

(setq message-send-mail-function 'smtpmail-send-it
      smtpmail-smtp-server "mixandgo.ro"
      smtpmail-auth-credentials
      '(("mixandgo.ro" 25 "cezar@mixandgo.ro" "askjdh983JK")))

(setq smtpmail-debug-info t smtpmail-debug-verb t)

(add-hook 'message-mode-hook
          (function (lambda()
                      (local-set-key (kbd "<tab>") 'bbdb-complete-name)
                      )))

(setq gnus-message-archive-group
      '((if (message-news-p)
            "sent.news"
          "sent.mail")))

(defun signature-to-end-of-forwarded-message ()
  (save-excursion
    (goto-char (point-min))
    (re-search-forward
     (concat "^" (regexp-quote mail-header-separator) "$") nil t)
    (forward-line 1)
    (let* ((start (point))
           (end (progn
                  (save-excursion
                    (re-search-forward "^------- Start of forwarded message -" nil t)
                    (beginning-of-line)
                    (point)))))
      (goto-char (point-max))
      (insert-buffer-substring (current-buffer) start end)
      (delete-region start end))))

(add-hook 'gnus-mail-forward-hook 'signature-to-end-of-forwarded-message)

(defun my-gnus-summary-view-html-alternative-in-mozilla ()
      "Display the HTML part of the current multipart/alternative MIME message
    in mozilla."
      (interactive)
      (save-current-buffer
        (gnus-summary-show-article)
        (set-buffer gnus-article-buffer)
        (let ((file (make-temp-file "html-message-" nil ".html"))
              (handle (nth 3 (assq 1 gnus-article-mime-handle-alist))))
          (mm-save-part-to-file handle file)
          (browse-url-firefox (concat "file://" file)))))

(define-key gnus-summary-mode-map [?K ?M]
  'my-gnus-summary-view-html-alternative-in-mozilla)

;; Rs Gnus Summary
(require 'rs-gnus-summary)
(rs-gnus-summary-line-initialize)
;; Alias for the content-type function:
(defalias 'gnus-user-format-function-ct 'rs-gnus-summary-line-content-type)
;; Alias for the size function:
(defalias 'gnus-user-format-function-size 'rs-gnus-summary-line-message-size)
(setq gnus-balloon-face-0 'rs-gnus-balloon-0)
(setq gnus-balloon-face-1 'rs-gnus-balloon-1)
(rs-gnus-summary-tree-arrows-ascii)





             reply	other threads:[~2007-09-09  9:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-09  9:31 Cezar [this message]
2007-09-12 19:43 ` Ted Zlatanov
     [not found]   ` <87tzpw7wz0.fsf@myhost.localdomain>
2007-09-17 21:19     ` Ted Zlatanov
2007-09-19 10:33       ` the (sorted) SPAM that CHANGED my LIFE jidanni

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=878x7gxjzy.fsf@myhost.localdomain \
    --to=cezar@mixandgo.ro \
    --cc=ding@gnus.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).