Mutt
|
Mailing lists
I have this magic for lists:
######## GENERAL MAILING LIST MAGIC # this is thanks to CrackMonkey :0D * ^(X-list: |Sender: owner-|X-BeenThere: |Delivered-To: mailing list |X-(Mailing-)?List: <|X-Loop: |List-I[dD]: <)\/[-A-Za-z0-9_+]+ .lists.$MATCH/
This identifies a list by it's internal name, and saves to directly to that name.
- Pro:
- can subscribe to new lists and not have to setup a new procmail filter for each one.
- Con:
- Some lists may have generic names (for instance 'general' or 'linux', both of which I'm subscribed to)
- Multiple lists may clash (this doesn't happen to me, but it could. Both 'general' and 'linux' are Linux User Group lists in different locations)
- If a false-negative spam matches these headers, it may create a folder and be additional work to clean up
- Other notes
- There may be multiple lists that you wish to conflate into one folder (eg: multiple freecycle). I handle this by symlinks within $MAILDIR
deliver-as-read (or trash)
Next up, I have this magic to let me selectively pre-mark messages as "read" (or even deleted) within a Maildir at delivery time. This speeds up reading some folders.
http://stuffphilwrites.com/2011/01/ultimate-procmail-recipe/
Counting Maildir folders
Another thing I have is a shell script wrapped around this command:
find ~/Maildir/new ~/Maildir/.*/new -iname \*.\* -not -iname \*:\*T\* -type f -printf "%p\0" | xargs -r -0 realpath | sort | uniq | awk -F / '{print $5}' | uniq -c | sort -gr
This is a very fast method to identify which Maildir folders have messages in 'new', and how many. Effectively being a folder list. It's fast enough that I have a variant of this in my shell *prompt* (variant simply counts how many folders ('|wc -l' instead of '|awk|uniq|sort').
Note that this one-liner strongly assumes .dot.seperated.folders, and will not work on /slash/seperated/folders. A slightly slower version will work on both slash and dot seperated:
find ~/Maildir -name cur -prune -o -name tmp -prune -o -path \*/new/\* -not -name \*:\*T\* -not -name \.\* -type f -printf '%h\n' | sed -e 's,.*/Maildir/\(.*\)/new,\1,g' | uniq -c | sort -gr
Archiving
I archive mail according to conversation/thread (thanks to gmail for that influence), and so I use mutt's superior thread management and tagging to do this.
Specifically, I tag all threads that are not within the most recent 600 newest messages, do not have any messages within the last 32 days, and have no messages that are New or Flagged. I also don't tag Deleted messages.
- magic folder-hook to tag messages for archivingfolder-hook . 'push "<sort-reverse>t<tag-pattern>~m 600- !~(~m -600) !~(~r <32d) !~(~N) !~(~F) !~D<enter><sort-mailbox>t<collapse-all>"' # tag messages for potential archiving
Todo
- I have muttrc config that lets me toggle between two different index displays, and three different levels of viewing headers.
- I archive old messages by thread (because gmail won me over to thread-based saving) and have a
See also
Finally: See also MailNews for notes on how I handle usenet through mutt *without* the nntp patch