Skip to content

Instantly share code, notes, and snippets.

@shanerutter
Created March 7, 2021 13:46
Show Gist options
  • Save shanerutter/24a32061909284be528849891018ac68 to your computer and use it in GitHub Desktop.
Save shanerutter/24a32061909284be528849891018ac68 to your computer and use it in GitHub Desktop.
#!/bin/sh
for domainhash in `cat /etc/userdomains | grep "\." | sed 's/ //'`
do
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
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment