X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=blobdiff_plain;f=gma.sh;h=1e79c72c96bbf3ba7d183730e433bdd3127aa3fe;hp=8725acc97a884103faf0696a297cb2a51b371bf8;hb=9fcf8afdc215faca5b95075189e582a9d8581942;hpb=88cc045a5eecced9d8f71c2a8e0aef67a8d94368 diff --git a/gma.sh b/gma.sh index 8725acc..1e79c72 100755 --- a/gma.sh +++ b/gma.sh @@ -20,7 +20,7 @@ set -e function usage () { - echo "gma.sh [--body] [--subject|--from|--to|--fromto|--subject] []" + echo "gma.sh [--body] [--keepspam] [--subject|--from|--to|--fromto] []" } RESULT_MBOX="/tmp/gma" @@ -67,6 +67,9 @@ while [[ $1 ]]; do *) if [[ ${PATTERN} ]]; then + # If we already have the pattern to match in the + # message, get the new argument as a pattern for the + # filename if [[ ${FILE_PATTERN} ]]; then usage exit 1 @@ -88,7 +91,7 @@ if [[ -z "${PATTERN}" ]]; then fi [[ ${FILE_PATTERN} ]] || FILE_PATTERN="${MAIL_ARCHIVE_DIR}/*/*/*" -[[ ${SIZE_FILE_PATTERN} ]] || SIZE_FILE_PATTERN="${MAIL_ARCHIVE_DIR}/" +[[ ${SIZE_FILE_PATTERN} ]] || SIZE_FILE_PATTERN="${MAIL_ARCHIVE_DIR}" SIZE=$(\dus ${SIZE_FILE_PATTERN} | cut -f 1 -d" ")