Deleting messages from account using the CLI

Deleting messages from account using the CLI

   KB 21721        Last updated on 07/11/2015  




0.00
(0 votes)

Purpose

CLI method for deleting messages off a specific user account.

Resolution

In order to delete the message, you need to identify the message "msgid". First, note which user you are trying to delete (replace user@domain.com with the user you are trying to target), then issue the following command to find the message "msgid" that you want to delete:

zmmailbox -z -m user@domain.com s -t message -l 50 "in:inbox date:01/01/2015"

The above command will search a specific folder, Inbox in this case. Displays only messages dated 01/01/2015. Lists up to 50 messages.

You will see something like the following after issuing the above command:

   Id    Type   From              Subject                                     Date   
   ----  ----   ----------------  ------------------------------------------  --------------
1. 432    mess  user              Daily mail report for 2015-01-01            01/01/15 23:30
2. 431    mess  user              ZCS Backup Report: SUCCESS                  01/01/15 01:00


The "msgid" is the first column labeled "Id".

This number can be used to delete the message by issuing the following command:

zmmailbox -z -m admin@william3.us.zimbralab.com deleteMessage 431

Additional Content


Verified Against: Zimbra Collaboration 8.5, 8.6 Date Created: 02/15/2015
Article ID: https://wiki.zimbra.com/index.php?title=Deleting_messages_from_account_using_the_CLI Date Modified: 07/11/2015



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Wiki/KB reviewed by Fred Raunaq Jenny Last edit by Jorge de la Cruz
Jump to: navigation, search