Add to Favourites Add to Favourites    Print this Article Print this Article

Automatically purge inbox and other IMAP folders

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.

Was this answer helpful?

Also Read