The command that manipulates mailboxes from CLI is zmmailbox. The following features are very usable:
-
Place user account into maintenance mode. This will prevent delivery of new mail messages until we finish with the backup procedure:
zmprov ma <user> zimbraAccountStatus maintenance
-
Archive user's mailbox in tar.gz format:
zmmailbox -z -m <user> getRestURL "//?fmt=tgz" > /tmp/<user>.tar.gz
-
Empty Inbox folder:
zmmailbox -z -m <sgros> ef /Inbox
-
Restore user's mailbox from tar.gz format:
zmmailbox -z -m <user> postRestURL "//?fmt=tgz&resolve=reset" /tmp/<user>.tgz
-
Put user's account into active mode:
zmprov ma <user> zimbraAccountStatus active
Leave a Reply