#!/bin/bash SPAMUSERDIR='/var/vmail/username/.Spam/cur/*' SPAMLEARNDIR='/tmp/SPAM' /bin/mkdir $SPAMLEARNDIR /bin/mv $SPAMUSERDIR $SPAMLEARNDIR /bin/chown -R amavis:amavis $SPAMLEARNDIR /bin/su - amavis -c 'sa-learn --dump magic' /bin/su - amavis -c "sa-learn --no-sync --spam $SPAMLEARNDIR" /bin/su - amavis -c 'sa-learn --dump magic' /bin/rm -rf /tmp/SPAM #service spamassassin reload