From 1d95aa9263475e71c60b26f2ea38bff998ed19d4 Mon Sep 17 00:00:00 2001 From: Dominic Ricottone Date: Tue, 13 Sep 2022 11:10:54 -0500 Subject: [PATCH] Removing wrapper I changed my mind about gracefully failing to use digestion. It's just best to make it a hard dependency. --- README.md | 16 ++++++---------- src/mailman.sh | 16 ---------------- 2 files changed, 6 insertions(+), 26 deletions(-) delete mode 100755 src/mailman.sh diff --git a/README.md b/README.md index b923ab8..c587eb9 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,9 @@ to,~.@lists.ubuntu.com =/usr/local/bin/parcels to,~.@lists.debian.org =/usr/local/bin/parcels | /usr/local/share/mail-filters/debian.awk from,~.@freebsd.org =/usr/local/bin/parcels | /usr/local/share/mail-filters/freebsd.awk from,~.+@googlegroups.com =/usr/local/bin/parcels | /usr/local/share/mail-filters/googlegroups.awk -from,~.+@lists.archlinux.org =/usr/local/share/mail-filters/mailman.sh -from,~.+@python.org =/usr/local/share/mail-filters/mailman.sh -from,~.+@gnu.org =/usr/local/share/mail-filters/mailman.sh +from,~.+@lists.archlinux.org =/usr/local/bin/digestion +from,~.+@python.org =/usr/local/bin/digestion +from,~.+@gnu.org =/usr/local/bin/digestion text/* =/usr/local/bin/parcels ``` @@ -71,11 +71,11 @@ elif grep --quiet -e '^From:.*@freebsd.org' "$TMP"; then elif grep --quiet -e '^From:.*@googlegroups.com' "$TMP"; then cat "$TMP" | /usr/local/bin/parcels | /usr/local/share/mail-filters/googlegroups.awk elif grep --quiet -e '^From:.*@archlinux.org' "$TMP"; then - cat "$TMP" | /usr/local/share/mail-filters/mailman.sh + cat "$TMP" | /usr/local/bin/digestion elif grep --quiet -e '^From:.*@python.org' "$TMP"; then - cat "$TMP" | /usr/local/share/mail-filters/mailman.sh + cat "$TMP" | /usr/local/bin/digestion elif grep --quiet -e '^From:.*@gnu.org' "$TMP"; then - cat "$TMP" | /usr/local/share/mail-filters/mailman.sh + cat "$TMP" | /usr/local/bin/digestion else cat "$TMP" | /usr/local/bin/parcels fi @@ -83,10 +83,6 @@ fi rm -f "$TMP" ``` -`mailman.sh` is a simple wrapper around `digestion` that gracefully handles the -that binary being unavailable. Meanwhile `parcels` is critical to using these -mail filters, so it is mandatory. - ## License All materials of this repository are licensed under BSD-3. A copy is included diff --git a/src/mailman.sh b/src/mailman.sh deleted file mode 100755 index feeeeb9..0000000 --- a/src/mailman.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# mailman.sh -# ========== -# A filter (as for mutt or aerc) which runs digestion and an awk filter. - -DIGESTION_INSTALL_DIR=/usr/local/bin -MAILFILTERS_INSTALL_DIR=/usr/local/share/mail-filters - -if command -v $DIGESTION_INSTALL_DIR/digestion 2>&1 >/dev/null; then - $DIGESTION_INSTALL_DIR/digestion -length $(tput cols) \ - | $MAILFILTERS_INSTALL_DIR/mailman.awk -else - $MAILFILTERS_INSTALL_DIR/mailman.awk -fi - -- 2.45.2