diff options
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | mark-maildir-seen | 27 |
2 files changed, 28 insertions, 0 deletions
@@ -17,6 +17,7 @@ scripts = \ jwt-decode \ keepalive \ lorem \ + make-maildir-seen \ mbox2maildir \ minimify \ musictomp3 \ diff --git a/mark-maildir-seen b/mark-maildir-seen new file mode 100755 index 0000000..a742a0b --- /dev/null +++ b/mark-maildir-seen @@ -0,0 +1,27 @@ +#!/bin/sh + +set -eu + +rename() { + local dirname="$1" + local pattern="$2" + local suffix="$3" + + find "$dirname"/cur "$dirname"/new -type f \ + -name "*:2,*" \ + ! -name "$pattern" \ + -exec mv '{}' '{}S' ';' +} + +mark_seen() +{ + local dirname="$1" + rename "$dirname" "*:2,*S*" "S" +} + + +for dirname in "$@" +do + mark_seen "$dirname" +done + |