X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=blobdiff_plain;f=gma.sh;h=1e79c72c96bbf3ba7d183730e433bdd3127aa3fe;hp=640c7f3cb4c16955526b0ed771903a96b3d70dff;hb=e34107eafa0bdd9c841cd7f84952937bc75c457b;hpb=c33caf969cac88b0b60cbec899ff1f3f24e39a31 diff --git a/gma.sh b/gma.sh index 640c7f3..1e79c72 100755 --- a/gma.sh +++ b/gma.sh @@ -20,7 +20,7 @@ set -e function usage () { - echo "gma.sh [--body] [--from|--to|--fromto] []" + echo "gma.sh [--body] [--keepspam] [--subject|--from|--to|--fromto] []" } RESULT_MBOX="/tmp/gma" @@ -61,8 +61,15 @@ while [[ $1 ]]; do RE_PREFIX="^(From|To):.*" ;; + "--subject") + RE_PREFIX="^Subject:.*" + ;; + *) 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 @@ -84,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" ")