From 329bc86a71e32397a131350a7bec26cdaa5a1271 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 1 Jun 2019 18:44:37 -0300 Subject: WIP: add scripts/mailing-list-import-mbox.sh Still only beginning to work, and only for GNU mailing lists. --- scripts/mailing-list-import-mbox.sh | 88 +++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100755 scripts/mailing-list-import-mbox.sh (limited to 'scripts') diff --git a/scripts/mailing-list-import-mbox.sh b/scripts/mailing-list-import-mbox.sh new file mode 100755 index 0000000..b0bb8ae --- /dev/null +++ b/scripts/mailing-list-import-mbox.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#!nix-shell --pure -i bash -p bash +# shellcheck shell=bash +set -Eeuo pipefail + +MAILING_LIST_NAME="${1:-}" +GNU_MBOX_ARCHIVE_URL='ftp://lists.gnu.org' +OUT_MAILDIR="$HOME/mbsync/EuAndreh/mailing-lists/" +TMP_DIR="$HOME/tmp/mbox-import/" +usage() { + cat < "${MAILING_LIST_NAME}.all.mbox" + mb2md -s "${TMP_DIR}/${MAILING_LIST_NAME}.all.mbox" -d "${OUT_MAILDIR}" + popd +} + +google_groups_import() { + echo "google groups ${MAILING_LIST_NAME}" +} + +main() { + [[ -z "${MAILING_LIST_NAME}" ]] && { + red "Missing input argument MAILING_LIST_NAME.\n" + usage + exit 2 + } + + echo "(1) - GNU mailing lists (lists.gnu.org)" + echo "(2) - Google Groups" + read -p "Which type of mailing list do you want to import? " -n 1 -r + echo # Move to a new line + case "$REPLY" in + "1") + gnu_mailing_list_import + ;; + "2") + google_groups_import + ;; + *) + red "Unsupported mailing list type." + red "Exitting." + usage + exit 2 + ;; + esac +} + +main "$@" + +# notmuch search --output=files tag:spam \ + # and not folder:${PREFIX}junk \ + # and not folder:${PREFIX}greyspam \ + # and not folder:Koumbit/INBOX \ + # and not path:Koumbit/** \ + # | while read file; do +# mv "$file" "$HOME/Maildir/${PREFIX}junk/cur" +# done + + +# notmuch search --output=files --exclude=false tag:deleted | xargs -I{} rm "{}" + + + +# https://julien.danjou.info/why-notmuch-is-not-much-good/ +# https://www.reddit.com/r/emacs/comments/6z13yw/notmuch_vs_imap_and_sieve/ +# https://anarc.at/blog/2016-05-12-email-setup/ +# https://duckduckgo.com/?q=notmuch+sieve&t=ffab&atb=v166-1&ia=web -- cgit v1.2.3