0

I need delete old messages from zimbra account.

by command:

zmmailbox -z -m [email protected] s -t message -l 999 "before:1/1/14" |awk '{ if (NR!=1) {print}}'| grep mess | awk '{ print $2 "," }' | tr -d '\n'

I can recieve ID messages and I can delete message by ID

zmmailbox -z -m [email protected] deleteMessage $ID

But between these two command, I would like to save the message in. tar.gz

1 Answer 1

0

You can create an backup with a command like:

zmmailbox -z -m [email protected] -t 0 getRestURL "//?fmt=tgz" > /tmp/mailbox.tgz

Where -t sets the timeout to infinity. You are creating a REST command to Zimbra, so you can extend this with compatible commands. For example, you can add a query to this to select message before a specific date:

zmmailbox -z -m [email protected] -t 0 getRestURL "//?fmt=tgz&query=before:12/31/2013" > /tmp/mailbox.tgz
1
  • 1
    How about backup messages before 1/1/14?
    – Mielofon
    Jan 29, 2016 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .