]> gitweb.fluxo.info Git - utils-mail.git/commitdiff
Enhance getmails-alternative
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 27 Jun 2022 11:21:22 +0000 (08:21 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 27 Jun 2022 11:21:22 +0000 (08:21 -0300)
getmails-alternative

index d85753a5545582ffe2a4dea6fe15b02ee457da32..cf36e5e136cd8ac7a053b1e95c5e1bb6e3cca832 100755 (executable)
@@ -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