#!/bin/bash mkdir -p /var/vmail/spam cp -al /var/vmail/*/*/Maildir/.ThisIsSpam/* /var/vmail/spam/ chown -fR debian-spamd:debian-spamd /var/vmail/spam su debian-spamd -c "/usr/bin/sa-learn --spam /var/vmail/spam" rm -fR /var/vmail/spam mkdir -p /var/vmail/ham cp -al /var/vmail/*/*/Maildir/.ThisIsNOTSpam/* /var/vmail/ham/ chown -fR debian-spamd:debian-spamd /var/vmail/spam su debian-spamd -c "/usr/bin/sa-learn --ham /var/vmail/spam" rm -fR /var/vmail/ham