diff -ruN smeserver-dirty-tools-0.1.0.old/root/sbin/e-smith/dt-dovecot-indexfiles-delete smeserver-dirty-tools-0.1.0/root/sbin/e-smith/dt-dovecot-indexfiles-delete --- smeserver-dirty-tools-0.1.0.old/root/sbin/e-smith/dt-dovecot-indexfiles-delete 2021-06-04 14:43:39.000000000 +0100 +++ smeserver-dirty-tools-0.1.0/root/sbin/e-smith/dt-dovecot-indexfiles-delete 2021-11-11 15:03:18.383879108 +0000 @@ -7,12 +7,17 @@ echo "Deleting Dovecot's index files"; -USERS=`/usr/bin/find /home/e-smith/files/users -type d -maxdepth 1` # users +# Find users - also finds /home/e-smith/files/users +USERS=`/usr/bin/find /home/e-smith/files/users -maxdepth 1 -type d` + +# Add Admin dir USERS="/home/e-smith/ $USERS" # admin + for u in $USERS; do +# Ignore dirs without Maildir ! /usr/bin/test -d $u/Maildir && continue /usr/bin/find $u/Maildir -maxdepth 2 -type f -name "dovecot.index*" -exec /bin/rm -f '{}' \; /usr/bin/find $u/Maildir -maxdepth 2 -type f -name ".imap.index*" -exec /bin/rm -f '{}' \; done - +echo "Completed";