home · contact · privacy
Restructure source file tree.
[config] / buster / home_files / user_eeepc / mail_sync.sh
diff --git a/buster/home_files/user_eeepc/mail_sync.sh b/buster/home_files/user_eeepc/mail_sync.sh
deleted file mode 100755 (executable)
index 0837390..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-set -e
-
-# 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
-    fi
-    target_dir="${basedir}"$(echo "${tag}" | cut -c5-)"/cur/"
-    for f in $(notmuch search --output=files tag:"${tag}"); do
-         new_name=$(basename "${f}" | sed -e 's/,U=[0-9]*//')
-         target_path="${target_dir}${new_name}"
-         if [ ! "${target_path}" = "${f}" ]; then
-             echo "Moving ${f} to ${target_path}."
-             mv "${f}" "${target_path}"
-         fi
-    done
-    notmuch tag -"${tag}" tag:"${tag}"
-done
-
-# Remove all "deleted"-tagged files from maildirs.
-notmuch search --output=files tag:deleted | while read f; do
-    echo "Deleting ${f}"
-    rm "${f}"
-done
-
-# Sync changes back to server and update notmuch index.
-mbsync -a
-notmuch new