Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-2009, 01:10 AM
Senior Member
 
Posts: 74
Arrow retrieve mails

A user has send a official mail to all of us in the firm, but the mail had some mistakes.
Is it possible to delete/ remove that particular mails from all of the recipients inbox?
Reply With Quote
  #2 (permalink)  
Old 12-03-2009, 01:37 PM
Moderator
 
Posts: 1,147
Default

Ok first of all you would need to get the message id for the message from each user. First you need a search in the same format that you search with in the WebUI that will find just that message for each user. Once you have this search replace "your search" in the following command and you will get all the message ID's that match it (This should only be 1 ID)
Code:
zmmailbox -z -m user@domain.com s -t message 'your search' | grep mess | awk '{print $2}'
You will then need to send that ID on to `zmmailbox deleteMessage` and it will delete the message for you.

Here is a small script that should work for what you want:
Code:
#!/bin/bash
for USER in `zmprov -l gaa`; do
    for MSGID in `zmmailbox -z -m $USER s -t message 'your search' | grep mess | awk '{print $2}'`; do
        zmmailbox -z -m $USER dm $MSGID;
    done;
done;
Reply With Quote
  #3 (permalink)  
Old 12-03-2009, 01:38 PM
Moderator
 
Posts: 1,147
Default

A couple of things I just thought of... this script will only work on users on the Zimbra server. Also to limit your search to just the inbox write it as "in:inbox your search".
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.