Avoiding the "huge INBOX of death"

Olivier Schwander olivier.schwander at chadok.info
Tue Jul 19 04:42:14 PDT 2016


Le 19 Jul 2016 11:42, Raphaël Fournier-S'niehotta a écrit:
> Hello fellow notmuchers,
> 
> I am a longtime "classic" mutt user, willing to switch to a notmuch-based
> solution (probably neomutt). However, as far as I understand, I will have to
> deal with a "huge INBOX of death", as put by Anarcat in a recent blog post [1],
> that when all emails remain in a single maildir, which may the become very
> large. 
> 
> I would like to avoid this, for quota reasons on my work imap server first, and
> also because I sometimes have to use webmail access, with poor searching
> capabilities.
> 
> Thus, I think I need to have my emails sorted into maildir folders according to
> the notmuch tags. Namely, emails with the "inbox" tag should stay in the INBOX
> maildir, those with "archive" should be moved to Archives (all synchronized with
> the server). As a bonus, it would be great to have a few more features, like
> "mails in Archives older than 6 months are moved to Archives/<year>" (kept
> locally and not stored on the server).
> 
> As far as I understand, "afew" and its MailMover feature could be useful for my
> case, but it does not seem currently maintained (plus, very few mentions of it
> on the notmuch archives) and Michael Turquette said it's buggy [2], so I would
> like more feedback to be sure before letting it mess with my maildir.
> 
> Another tool that could be useful is the "maildir-notmuch-sync" script written
> by Ethan Schoonover and adapted by Michael Turquette [3]. However, it seems
> dedicated to handling the synchronization of Gmail labels, not a generic imap
> server hierarchy.
> 
> Perhaps there is another solution to deal with this in a notmuch-based setup, I
> would very much like any of your feedback.
> 
> [1]: https://anarc.at/blog/2016-05-12-email-setup/
> [2]: http://deferred.io/2016/01/17/state-of-the-dotfiles.html
> [3]: http://deferred.io/2016/01/18/notmuch-tags-gmail-labels-bidirectional-sync.html

You could use fdm [1] to store messages into a folder hierarchy based on
the date in the messages. In the past, I used something like that to
periodically move messages in my inbox to sub-folder with the year:

account "archives" disabled maildirs {
   "${mailpath}INBOX"
}
action "archive" maildir "${mailpath}%[maildir]/%[mail_year]"
match account "archives" {
    match age > 6 months action "archive"
    match all action keep
}

Nowadays, I use a custom script [2] to mirror some notmuch queries to
maildirs (ran periodically in my crontab), such like:

notmuch-imap.sh ~/Maildir/ NOT tag:archive AND NOT tag:killed AND NOT tag:spam AND tag:inbox
notmuch-imap.sh ~/Maildir/.todo NOT tag:archive AND NOT tag:killed AND NOT tag:spam AND tag:todo

Both solutions works server-side, since I control my own mail server but
it may probably used in an offlineimap hook.

Best,

Olivier

[1]: https://github.com/nicm/fdm
[2]: https://chadok.info/~oschwand/poubelle/e53f1d9ac30909fd17ca98f4160375bbc9a6aca5/notmuch-imap.sh.html



More information about the notmuch mailing list