home · contact · privacy
Minor corrections.
[config] / buster / home_files / user_eeepc / mail_sync.sh
index d20690d3606374f618f2d070c0ca14b730522274..0837390302a4b9d05e55f5bfae163b74969a56be 100755 (executable)
@@ -1,8 +1,9 @@
 #!/bin/sh
 set -e
 
-# Ensure all "dir:*"-tagged mails are in proper directories.
-basedir="/home/plom/test_mbsync/maildir/"
+# Ensure all "dir:*"-tagged mails are in proper directories,
+# remove all "dir:*" tags.
+basedir="/home/plom/mail/maildir/"
 for tag in $(notmuch search --output=tags '*'); do
     if [ ! $(echo "${tag}" | cut -c-4) = "dir:" ]; then
         continue
@@ -16,6 +17,7 @@ for tag in $(notmuch search --output=tags '*'); do
              mv "${f}" "${target_path}"
          fi
     done
+    notmuch tag -"${tag}" tag:"${tag}"
 done
 
 # Remove all "deleted"-tagged files from maildirs.