Automatically purge inbox and other IMAP folders

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » Email

Automatically purge inbox and other IMAP foldersLast Modified: Apr 27, 2010, 12:51 pm
The only automated purge tool DA has is for the Spambox and Trash data.
Admin Level -> Admin Settings -> Automatically Purge Spambox/Trash data

The inbox and other folders (inbox + other) won't be touched by DA as it would be considered live data that User may want.

If you needed to purge that data anyway, you'd likely need to create a script that uses the "find" command, and use the -mtime option, eg:

find /home/*/imap/*/*/Maildir -mtime +30 | grep -E '/cur/|/new/'

but double check the output before using it to ensure the syntax is what you need.

Once satisfied it's generating the files you want, try:

rm -f `find /home/*/imap/*/*/Maildir -mtime +30 | grep -E '/cur/|/new/'`

Just be very careful and double check all of the syntax, else it might delete files you don't want.
Related Helpfiles
Cannot delete oversized directories: /bin/rm: Argument list too long
How to purge the Maildir inbox for all system accounts: /home/user/Maildir

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST