3 # retrieves the system's spam pile from sa-exim's spool folder and
4 # moves it to the user's home directory. sudo access is required
5 # for the file moving operations.
6 # after the spam is all snagged, it is scanned for any untoward presence
7 # of non-spam folks using the user's valid email list.
9 # the storage area that the spam catcher tool puts the suspected spam into.
10 SPAM_SPOOL="/var/spool/sa-exim"
11 # a temporary directory where we'll move all the spam for analysis.
12 SPAM_HOLD="$HOME/spamcrud"
13 # the white list needs to be a file of good email addresses that will
14 # probably never send spam. it should be formatted one address to a line.
15 EMAIL_WHITE_LIST="$HOME/quartz/database/email_addresses.txt"
16 # we'll save a report of the spam checks in the file below.
17 REPORT_FILE="$HOME/spam_check_report.txt"
19 if [ ! -d "$SPAM_HOLD" ]; then
22 echo "The operation to move the spam files requires sudo privileges..."
23 sudo find "$SPAM_SPOOL" -type f -exec mv {} "$SPAM_HOLD" ';'
25 echo "The spam moving operation failed, which probably means we failed to get sudo access"
28 echo "Setting the directory back to user's ownership..."
29 sudo chown -R $USER "$SPAM_HOLD"
30 sudo chgrp -R $USER "$SPAM_HOLD"
31 echo "Running checker for false-positive spams..."
32 bash "$FEISTY_MEOW_SCRIPTS/email/scan_spam.sh" "$SPAM_HOLD" "$EMAIL_WHITE_LIST" 2>&1 \