mutt workflow and mail filtering

Cameron Simpson cs at cskk.id.au
Mon May 6 05:59:04 UTC 2019


On 05May2019 23:12, benfitzg at gmail.com <benfitzg at gmail.com> wrote:
>I moved to using offlineimap to sync my gmail to a local Maildir 
>format, then I point mutt at the local filesystem.
>This has greatly improved my mutt experience. Loading large folders is 
>far snappier.
>
>I'm not that enamoured with gmail filtering,

Me either, it's rubbish.

I'll describe what I do below.

>and I'd like to be able to control
>filtering at the Maildir level, then have offlineimap sync the changes back up
>to the server side.
>
>So a typical example might be, assuming I have no gmail filters setup and
>everything is dumped into my INBOX.
>
>- mutt mailing list email arrives at gmail into INBOX
>- offlineimap pulls this down to my local $Maildir/INBOX/new
>- post-sync hook runs and moves the email to $Maildir/Mutt/new
>- offlineimap syncs back up on the server side, deleting from INBOX and writing to Mutt
>
>I've used gmail as an example here but I'm also looking to implement a similar
>solution at work where I have to use Microsoft Exchange server, which has a really
>terrible rules interface.

Ny mail filtering is maildir based. I fetch from my ISP with getmail 
which simply delivers to my "+spool" maildir. My mail filer watches that 
directory and filters anything which lands there.

To use such a scheme for gmail I'd imagine watching the local INBOX 
maildir and filtering everything which shows up; one side effect is that 
INBOX would stop being your inbox, and something else would need to 
become so.

My mail filer is here:

  https://pypi.org/project/cs.app.mailfiler/

which installs a "mailfiler" command along with it. I imagine there may 
be other maildir focussed filter programmes out there. Mine has simple 
rules for the simple stuff and a decent syntax for arbitrary stuff, and 
does a proper parse of the mail headers unlike procmail's regexp based 
approach.

Happy to go into more detail if you want it, either on my filtering flow 
(spool->spool-in->(many-places)) of the mailfiler command itself.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Mutt-users mailing list