#!/bin/bash if [ -d "${1}" ]; then MAILS="`ls ${1}`" if [ ! -z "${MAILS}" ]; then for MAIL in ${MAILS} do echo "Report ${1}/${MAIL}" spamassassin -r < "${1}/${MAIL}" echo "Delete ${1}/${MAIL}" rm "${1}/${MAIL}" done fi if [ -z "${MAILS}" ]; then echo "Nothing in ${1} to report!" fi fi