Answer the question
In order to leave comments, you need to log in
How to delete old Postfix+Dovecot / CentOS6 emails?
Good day to all!
Tell me how you can delete old letters (three years old) through the console.
df
Filesystem 1K-blocks Used Available Use % Mounted on
/dev/md2 1905695580 1757628360 51256780 98% /
tmpfs 16368860 0 16368860 0% /dev/shm
/dev/md1 507684 120876 360597 26% /boot
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/md2 116M 1.7M 114M 2% /
tmpfs 4.0M 9 4.0M 1% /dev/shm
/dev/md1 128K 63 128K 1% /boot
Answer the question
In order to leave comments, you need to log in
find /mail/dir -type f -mtime +1095 -delete
/mail/dir directory with letters
-mtime +1095 older than 1095 days
-delete delete
first check the list of files for deletion something like thisfind /mail/dir -type f -mtime +1095 -print
By date for all mailboxes
By term (over 12 weeks) for user [email protected]
Other options: https://wiki.dovecot.org/Tools/Doveadm/SearchQuery
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question