summaryrefslogtreecommitdiff
path: root/mark-maildir-seen
diff options
context:
space:
mode:
Diffstat (limited to 'mark-maildir-seen')
-rwxr-xr-xmark-maildir-seen27
1 files changed, 27 insertions, 0 deletions
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
+