aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2022-06-27 08:21:22 -0300
committerSilvio Rhatto <rhatto@riseup.net>2022-06-27 08:21:22 -0300
commit15c561fccdc3e2d2fc8e2f9072a7bbd47554549d (patch)
tree35f01624d348b680d06a603173234b84ff9f2958
parentce87445c334139fb325a00c767b941e0686f7d22 (diff)
downloadutils-mail-15c561fccdc3e2d2fc8e2f9072a7bbd47554549d.tar.gz
utils-mail-15c561fccdc3e2d2fc8e2f9072a7bbd47554549d.tar.bz2
Enhance getmails-alternativeHEADmaster
-rwxr-xr-xgetmails-alternative8
1 files changed, 6 insertions, 2 deletions
diff --git a/getmails-alternative b/getmails-alternative
index d85753a..cf36e5e 100755
--- a/getmails-alternative
+++ b/getmails-alternative
@@ -2,11 +2,15 @@
#
# Simple wrapper around getmail to fetch from all active accounts.
# Alternative to the getmails(1) wrapper.
+#
+# Supports different config folders, including configurations stored
+# in subfolders of $HOME/.config/getmail.
+#
# See http://pyropus.ca/software/getmail/configuration.html#running-commandline-options
#
# Parameters
-CONFIG_FOLDER="$HOME/.getmail/config"
+CONFIG_FOLDER="${1:-$HOME/.config/getmail}"
GETMAIL="/usr/bin/getmail"
# Check
@@ -15,4 +19,4 @@ if [ ! -d "$CONFIG_FOLDER" ]; then
fi
# Dispatch
-ls -1 $CONFIG_FOLDER | grep -v '^oldmail-' | grep '@' | grep -v '.disabled$' | xargs echo | sed -e 's/ / --rcfile /g' | xargs $GETMAIL --rcfile
+ls -1 $CONFIG_FOLDER | grep -v '^oldmail-' | grep '@' | grep -v '.disabled$' | xargs echo | sed -e 's/ / --rcfile /g' | xargs $GETMAIL -g$CONFIG_FOLDER --rcfile