On 07Nov2012 14:15, Chris Green <c...@isbd.net> wrote:
| I also have a fairly complex mail filtering script I wrote myself in
| Python which is fed mail via .forward.
| 
| What's the current "state of the art" way to collect mail and deliver it
| through a filtering system to mutt?  If I can do this all in one program
| than so much the better but I'm happy with two programs if that would
| work better.  I can stay with my existing filter system but, again, if I
| can consolidate things into one, easier to maintain, chunk then I'd be
| happy. 
| 
| I *don't* like procmail configuration files, they're one of the reasons
| I wrote my own.
| 
| What does everyone else here do for collecting mail and filtering mail
| with mutt?

I collect email with getmail and deliver it to my "spool" folder.

I file mail with "mailfiler", a python program of my own, to monitor the
"spool", "spool-in", "spool-out" and "spool-spam-subj" maildirs.  It
understands extremely easy to write and read filter rules, eg:

  =spam SPAM-SUBJ subject:/^You have 24 hours left to TRIPLE your deposits

  !=me,$EMAIL_IPHONE .  to,cc:(ME)
                        from:(FAMILY|FRIENDS|[...snipped: other mail group 
names])

  mutt    Mutt-Users    mutt-users@mutt.org

The first rule uses a regexp on the subject header and diverts matching
messages to my "spam" mail folder/septic-tank.

The second rule does proper address parsing of the named headers and (in
the example above) checks addresses against sets of addresses in my
maildb. Almost instant, and very reliable. The "!" means issue an
"alert", for "important" messages.

The third rule also does a proper address parse of to/cc/bcc and if
"mitt-us...@mutt.org" is there, saves the message in the "mutt" folder
with the "Mutt-Users" X-Label header added.

I've actually described my setup at some length on the list just
recently, here and here:

  http://www.mail-archive.com/mutt-users@mutt.org/msg45217.html
  http://www.mail-archive.com/mutt-users@mutt.org/msg45215.html

outlining my setup, why I don't use procmail, what I used to do to beat
procmail into order in the past, etc.

In short, the rules for "spool" divert spam and copy other messages to
"spool-in". The rules for "spool-in" file messages into my main inbox
and multitudinous other folders for mailing lists. "spool-out" is for
cross filing copies of my outbound email.

Aside: "spool-spam-subj" is for recording the subject lines of all messages
  filed there as to be considered spam. So I've got a mutt macro to save a
  repetitious spam to that folder, and the rules there add a new rule to my
  spam filter:-) Mailfiler notices rule updates on the fly.

Because mailfiler runs in the background, polling very regularly (1Hz,
and the machine load for that is insignificant), if I modify my rules
all I need to do to refile a message via the rules is to save it into
"spool-in" again. And off it goes. Of course there is a log file to tail
to watch this stuff happen.

There's a man page for the mailfiler rule syntax here:

  https://bitbucket.org/cameron_simpson/css/src/tip/man/mailfiler.5.pod

and for mailfiler itself here:

  https://bitbucket.org/cameron_simpson/css/src/tip/man/mailfiler.1.pod

Source code:
  
  
https://bitbucket.org/cameron_simpson/css/src/tip/lib/python/cs/app/mailfiler.py

Cheers,
-- 
Cameron Simpson <c...@zip.com.au>

On 12/22/07, Brian Hansen <greencopperm...@gmail.com> wrote:       
> 2. Rather than auditing a lot of code, correcting a lot of coding mistakes,
> like the OpenBSD security team has done, and still do, why not shift from C
> to something, just as fast and powerfull as C, but more secure? Again like
> Ada. (to completely avoid the possibilities of those errors).
why did you write your email in english?  esperanto is simpler and
less error-prone.
- Ted Unangst <ted.unan...@gmail.com> in misc.openbsd.org

Reply via email to