]> git.rmz.io Git - dotfiles.git/commitdiff
mbsync: delete youtube hook
authorSamir Benmendil <me@rmz.io>
Wed, 12 May 2021 19:10:03 +0000 (20:10 +0100)
committerSamir Benmendil <me@rmz.io>
Wed, 12 May 2021 19:10:03 +0000 (20:10 +0100)
Google has stopped sending out these emails, so there's no point in
running the hook anymore.

mbsync/post-sync.d/10-youtube.hook [deleted file]

diff --git a/mbsync/post-sync.d/10-youtube.hook b/mbsync/post-sync.d/10-youtube.hook
deleted file mode 100755 (executable)
index de02bba..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env bash
-
-maildir="$MAILDIR/mailfence"
-yt_src_mb=youtube-orig
-yt_dst_mb=youtube
-yt_parser=$dir/parse-mail.py
-
-if [[ $mbsync_errno -ne 0 ]]; then
-    echo "mbsync failed, ignoring post-sync commands." >&2
-    exit
-fi
-
-mbsync_args=$*
-
-if [[ "$mbsync_args" != "mailfence" ]]; then
-    # only run for mailfence account
-    exit
-fi
-
-shopt -s extglob
-shopt -s nullglob
-
-if [[ ! -d "$maildir/$yt_src_mb" ]]; then
-    echo "No mailbox at '$maildir/$yt_src_mb'"
-    exit
-fi
-
-for mail in "$maildir"/$yt_src_mb/new/* ; do
-    mangled_mail=${mail/$yt_src_mb/$yt_dst_mb}
-    # remove UID for mbsync to regenerate it
-    mangled_mail="${mangled_mail/,U=+([0-9])}"
-
-    echo -n "Parsing new message '$(basename "$mail")'..."
-    $yt_parser <"$mail" >"$mangled_mail"
-
-    if [[ $? -eq 0 ]]; then
-        echo " Success."
-    else
-        echo " Failure! Copying message as is."
-        cp "$mail" "$mangled_mail"
-    fi
-
-    # sync {a,m}time
-    touch --reference "$mail" "$mangled_mail"
-    mv "$mail" "${mail/new/cur}S"
-done
-
-# resync new yt_dst_mb
-mbsync -c "$config" mailfence-youtube