Code: Select all
USER='*' # enter user if you don't want * users (*=all)
DOMAIN='*' # enter domain if you don't want * domains (*=all)
MAILACC='*' # enter mail account if you don't want * mail accounts (*=all)
find /home/$USER/mail/$DOMAIN/$MAILACC/.Spam/new/ -type f -delete
find /home/$USER/mail/$DOMAIN/$MAILACC/.Spam/cur/ -type f -delete
find /home/$USER/mail/$DOMAIN/$MAILACC/.Spam/tmp/ -type f -delete
find /home/$USER/mail/$DOMAIN/$MAILACC/.Spam/ -type f -delete
find /home/$USER/mail/$DOMAIN/$MAILACC/.Trash/new/ -type f -delete
find /home/$USER/mail/$DOMAIN/$MAILACC/.Trash/cur/ -type f -delete
find /home/$USER/mail/$DOMAIN/$MAILACC/.Trash/tmp/ -type f -delete
find /home/$USER/mail/$DOMAIN/$MAILACC/.Trash/ -type f -delete
systemctl restart dovecot