summaryrefslogtreecommitdiff
path: root/localrmstaleaccounts
diff options
context:
space:
mode:
Diffstat (limited to 'localrmstaleaccounts')
-rwxr-xr-xlocalrmstaleaccounts6
1 files changed, 1 insertions, 5 deletions
diff --git a/localrmstaleaccounts b/localrmstaleaccounts
index c830fb0..41cb602 100755
--- a/localrmstaleaccounts
+++ b/localrmstaleaccounts
@@ -73,11 +73,7 @@ for user in "$@"; do
warn "Skipping user $user: target in /etc/aliases"
elif find -- /var/lib/radicale/collections/collection-root -maxdepth 1 -type d -name "$user" -not -empty | grep -q '^'; then
warn "Skipping user $user: Uses Radicale"
- elif find "$home/Maildir/new" -maxdepth 0 -type d -mtime +365 | grep -q .; then
- remove_account "$user" "Removing user $user: Maildir INBOX/new untouched for a year"
- elif find "$home/Maildir/cur" -maxdepth 0 -type d -mtime +365 | grep -q .; then
- remove_account "$user" "Removing user $user: Maildir INBOX/cur untouched for a year"
- elif find "$home/Maildir/new" -type f -mtime +365 | grep -q .; then
+ elif doveadm search -u "$user" MAILBOX INBOX SAVEDBEFORE 52weeks NEW | grep -q .; then
remove_account "$user" "Removing user $user: new mail in INBOX untouched for a year"
else
info "Skipping user $user"