loranloran

delete all trash, junk mails from all domains and accounts

May 14th, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. for domainhash in `cat /etc/userdomains | grep "\." | sed 's/ //'`; do
  2. read domain user <<<$(echo $domainhash | sed 's/:/ /'); find /home/${user}/mail/${domain}/*/.Trash/{cur,new,tmp}/ -type f | xargs -ifile rm -f file; find /home/${user}/mail/${domain}/*/.Junk/{cur,new,tmp}/ -type f | xargs -ifile rm -f file; rm /home/${user}/.trash/* -rf; done
Add Comment
Please, Sign In to add comment