Skip to content

Instantly share code, notes, and snippets.

@jlevon
Created February 12, 2021 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlevon/eb2d041c97be7295fa6b017eceec0e5d to your computer and use it in GitHub Desktop.
Save jlevon/eb2d041c97be7295fa6b017eceec0e5d to your computer and use it in GitHub Desktop.
mute thread in procmail
:0 Wfh: formail.lock
| $HOME/src/procmail-thread/match-thread.sh $HOME/.refs.muted "Procmail-Muted: true"

:0
* Procmail-Muted: true
{
        SWITCHRC=$HOME/.procmailrc.markread
}


$ cat .procmailrc.markread 

#
# Courtesy of https://stuffphilwrites.com/2011/01/ultimate-procmail-recipe/
#

:0
{
  :0c # store as new
  "$DEST/"

  :0 # move to cur/ and append a :2,S to mark as read ("seen")
  * LASTFOLDER ?? /\/[^/]+$
  { tail=$MATCH }
  TRAP="mv '$LASTFOLDER' '$DEST/cur/$tail:2,S'"

  HOST
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment