initial commit of file from CVS for smeserver-dirty-tools on Sat Sep 7 20:17:20 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:17:20 +10:00
parent 2afadab596
commit d11a58da6a
14 changed files with 789 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
#!/bin/bash
# (C) 2008 Michael Weinberger
# See http://wiki.contribs.org/Dirty_Tools for full documentation
# Sometimes Dovecot index files are corrupted after a restore
# It is save to delete them all. Dovecot will rebuild them when the mailbox is accessed.
echo "Deleting Dovecot's index files";
# 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";