0

I need delete old messages from zimbra account.

by command:

zmmailbox -z -m mail@domain.com 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 mail@domain.com deleteMessage $ID

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

Mielofon
  • 101
  • 3

1 Answers1

0

You can create an backup with a command like:

zmmailbox -z -m mail@domain.com -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 mail@domain.com -t 0 getRestURL "//?fmt=tgz&query=before:12/31/2013" > /tmp/mailbox.tgz
Micha Kersloot
  • 409
  • 2
  • 9