V
V
VA2015-12-22 15:45:22
Mail server
VA, 2015-12-22 15:45:22

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

df-hi
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

2 answer(s)
F
falsebyte, 2015-01-02
@falsebyte

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 this
find /mail/dir -type f -mtime +1095 -print

N
Nikita Tratorov, 2018-10-30
@NikitaTratorov

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 question

Ask a Question

731 491 924 answers to any question