Last active
August 29, 2015 14:03
-
-
Save ThomasLeister/4a8bfd8fd6c99d8e0185 to your computer and use it in GitHub Desktop.
Teach Spamassassin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### | |
### The full path to a user's mailbox is: /var/vmail/domain/user/mail/ | |
### This script runs through the users' mailboxes and runs the sa-learn command to practise | |
### Spamassassin based on the mailbox contents. Spam is collected in the Spam/ directory of every single mailbox | |
### | |
DOMAINS="domain1 domain2 domain3" | |
cd /var/vmail/ | |
for DOMAIN in $DOMAINS; do | |
echo "Entered domain dir $DOMAIN" | |
cd "$DOMAIN/" | |
for USER in $(ls); do | |
echo "Entered user dir $USER" | |
cd "$USER/mail/" | |
### Learn Spam ### | |
sa-learn --spam "Spam/" | |
### Learn Ham ### | |
sa-learn --ham "Sent/" | |
cd "../../" | |
done | |
cd "../" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment