Do you have access to the command line?
I used some Ruby to do this with Zimbra command line tools...
Code:
#Mark and Purge Old Messages
msg_ids_for_deletion = smb(folder_path, "before:-30days")
dm(msg_ids_for_deletion)
msg_ids_for_marking = smb(folder_path, "before:-1day")
if !msg_ids_for_marking.empty?
mmr(msg_ids_for_marking)
end I've written some other Ruby that allows me to call Zimbra CLI commands with some parameters, that why I just call
Code:
smb(PATH, SEARCH_TERM)
and
and
...instead of having to type out the full command.....but in Ruby you can do that with something like this...
Code:
msg_ids_for_deletion = `zmprov -z -a ACCOUNT search -l NUM -t message "in:Inbox before:-30days after:-60days"`
results = `zmprov -z -a ACCOUNT deleteMessage #{msg_ids_for_deletion}` ...or something like that anyway. That should search for and find all messages between 30 and 60 days old....and delete them. Test and verify first though as I'm just pulling most of that from memory.
Matt