Using bogofilter with local Maildirs (and offlineimap)
Gyepi SAM
gyepi at praxis-sw.com
Wed Oct 6 16:04:42 CEST 2004
On Wed, Oct 06, 2004 at 12:57:42PM +0200, Gaizka wrote:
> My setup is:
> - My ISP gives me IMAP access
> - I synchronize it with my desktop with offlineimap.
> - I then have a local tree of Maildirs in my desktop
>
> I'd like to filter my local tree of Maildirs with bogofilter.
>
> Does anybody have a setup similiar to this one?
> Has anybody written a script to run bogofilter through the Maildirs
> and filter them, or should i write my own?
You don't need to write a script for this: there are existing tools to help
with it. You need maildircmd and safecat [1], both written by Len Budney.
Here's how I have solved a similar problem:
1. Deliver your mail to a temporary Maildir. Let's call it Maildir/spool
2. Then run maildircmd on Maildir/spool and feed the results to safecat, which
delivers the filtered mail to your inbox, say Maildir/inbox.
maildircmd Maildir/spool "" "bogofilter $bogofilter_options| \
safecat Maildir/inbox/tmp Maildir/inbox/new
Ideally, you would want to filter your mail into separate mailboxes.
That's where procmail or mailfilter come in.
-Gyepi
[1] http://mysite.verizon.net/vze1ypud/linux/software/maildircmd.html
More information about the Bogofilter
mailing list