Gnus development mailing list
 help / color / mirror / Atom feed
From: Scott A Crosby <scrosby@cs.rice.edu>
Cc: Jonas Steverud <d4jonas@dtek.chalmers.se>
Subject: Re: Splitting and procmail
Date: 08 Sep 2002 22:40:33 -0500	[thread overview]
Message-ID: <oydr8g3n83y.fsf@bert.cs.rice.edu> (raw)
In-Reply-To: <wtnheh098mq.fsf@licia.dtek.chalmers.se>

On Sun, 08 Sep 2002 10:40:45 +0200, Jonas Steverud <d4jonas@dtek.chalmers.se> writes:

> I have mail-source set to '((directory :path "~/Mail" :suffix "")) and
> is using procmail to filter my email.

I am using maildir because I don't trust anything else, especially
over NFS. I use Safe-Cat to do mail-injection.

(setq mail-sources '((maildir :path "~/Mesg/Spool/" :subdirs ("Inbox.Bulk" "Inbox.Spam" "Inbox.Rest"))))

I am NOT using procmail for any actual catagorization.. IE, procmail
dumps all mail into those 3 maildirs. Gnus reads all 3 of them. (The
reason for this is so that I can 'less +/.*Rest.*
~/Mesg/Spool/logfile' and put 'less' into tail-mode and look for
hilighted lines.

Procmail does run some analysis routines, right now, Spamassassin, and
in the future, maybe my bayes classifier or DNSRBL's. But gnus does
the actual splitting into seperate folders.

I do this because I don't really want to have two different levels and
two/three different types of mail catagorization rules. Better to put
them all in ONE system. So, I have all of my actual catagorization
rules in nnmail-split-fancy... Which seems to be a nice superset of
procmail anyways.

I may later add in extra spamassassin rules 'FLAG_FOO' with low
weights ~.000001 soley as flags for nnmail-split-fancy rules to match
on: ("X-Spam-Status" "FLAG_PROJECT_FOO" "projects.foo"). Or, I may
instead chose to do it via functional nnmail-split-fancy rules that
scan the body for regexps.

> My idea was to use mail splitting (maybe the fancy one too) and have
> procmail do the spam filtering. I.e all mail except for spam are
> placed in Mainmailbox and all spam are placed in Spam. Mainmailbox
> should be splitted but the Spam box should not.
> 
> Possible or are there a better solution?

One option is to use 'formail' within procmail to put a special header
on what you classify as spam and have the first split-fancy rule match
on that header and put matching emails into the spam folder.

(setq nnmail-split-fancy
      '(| 
         ("My-Procmail-Classification"  "Spam" "junk.spam")
         ("My-Procmail-Classification"  "Family" "family")
         "inbox"))

> I have fairly nice spam filtering in my procmail and I don't want to
> rewrite it as splitting rules (takes too much time). I am also

I'm curious.. What does your system look like? Why not rewrite it,
piecemeal, into fancy-split-mail rules? split-fancy is so much nicer
to use than procmail, its not funny. I put 5 pages of almost
ununderstandable procmail rules into barely a screen of split-fancy
rules.

Not to mention.. split-fancy-with-parent is a GODSEND. Whomever wrote
it.. THANK YOU![1]

> planning to start using Spamassassin (the spam.el seems interesting, I
> really like the idea with using BBDB as a whitelist since I consider
> all mails from MSN, Hotmail, Yahoo et al as spam) so I seems to need
> procmail however I do.

Spamassassin offers an automatic whitelist option where it looks at
the average score for email claiming to be from a particular user and
adjusts itself as suited. With a threshold of 5, its had only one
false-positive. (An orbitz confirmation email for some tickets I'd
just bought.)

> Or does someone have a script that converts a procmailrc to a
> split rule(s)? ;-)

Maybe you should write one? :)

Scott


[1] I do have one feature request.. It'd be nice if you could define a
list of regexps that it was NOT to return. Something like:

(defun my-split-fancy-with-parent ()
  "Do a split-with-parent, however, ignore the result if it wants to put it in sent-mesg. This way, we put followups in the same group, however, we never put followups into sent-mesg."

  (let ((my-split (nnmail-split-fancy-with-parent)))
    ;;(message "Doing-my-split-fancy-with-parent")
    ;;(message my-split)
    (if (or (null my-split) (string-match "sent-mesg" my-split))
	nil
      my-split)))



  parent reply	other threads:[~2002-09-09  3:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-08  8:40 Jonas Steverud
2002-09-08 12:33 ` Reiner Steib
2002-09-09  0:14   ` Harry Putnam
2002-09-09  9:30     ` Kai Großjohann
2002-09-09 12:39     ` Reiner Steib
2002-09-09 13:06       ` Kai Großjohann
2002-09-09 13:54         ` Reiner Steib
2002-09-09 14:09           ` Kai Großjohann
2002-09-09 16:39         ` Harry Putnam
2002-09-08 12:44 ` Mark Triggs
2002-09-08 14:31   ` Jonas Steverud
2002-09-09  0:31   ` Harry Putnam
2002-09-09  4:32     ` Mark Triggs
2002-09-09  3:40 ` Scott A Crosby [this message]
2002-09-09  9:32   ` Kai Großjohann
2002-09-10 11:25   ` Jonas Steverud
2002-09-11 13:29     ` Jonas Steverud
2002-09-13 17:51       ` Jonas Steverud

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=oydr8g3n83y.fsf@bert.cs.rice.edu \
    --to=scrosby@cs.rice.edu \
    --cc=d4jonas@dtek.chalmers.se \
    /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).