Created
April 15, 2014 22:04
-
-
Save paceline/10781525 to your computer and use it in GitHub Desktop.
Simple script for automatically emptying Spam and Trash folder
This file contains hidden or 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/bash | |
# | |
# Simple script for automatically emptying Spam and Trash folders | |
# | |
# Ulf Möhring <[email protected]> | |
# | |
echo "[Mail scripts] Emptying users' trash and spam folders..." | |
for email in $(find /var/mail/vhosts/*/* -regextype sed -regex ".*/\.\(Trash\|Spam\)/\(cur\|new\)/.*" -type f -mtime +30); do | |
rm -f "${email}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment