Results 1 to 3 of 3

Thread: retrieve mails

  1. #1
    Join Date
    Nov 2009
    Posts
    89
    Rep Power
    6

    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?

  2. #2
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    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;

  3. #3
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    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".

Similar Threads

  1. Migrating my mails from Microsoft Outlook 2003 to Zimbra
    By Ashwin in forum General Questions
    Replies: 1
    Last Post: 04-10-2009, 04:14 PM
  2. [SOLVED] Retrieve Mails in crashed Desktop
    By anupsur in forum General Questions
    Replies: 2
    Last Post: 03-04-2009, 10:46 AM
  3. Replies: 5
    Last Post: 06-18-2008, 02:50 AM
  4. "NO APPEND failed" message when migrating mails
    By tkrag@mostlyharmless.dk in forum Administrators
    Replies: 8
    Last Post: 05-18-2007, 07:25 AM
  5. sql query to retrieve mails store path
    By banou in forum Developers
    Replies: 10
    Last Post: 05-02-2007, 07:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •