Results 1 to 3 of 3

Thread: [SOLVED] Batch delete of specific emails in account

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Location
    Palma, Majorca, Balearic Islands, Spain
    Posts
    44
    Rep Power
    7

    Default [SOLVED] Batch delete of specific emails in account

    Hello everyone!

    I have an account that has been the target of a spam attack, with over 22.000 spam emails now in the inbox folder. I am trying to find a way to get a list of all messages, filter them with the usual grep/cut/sed/awk tools and get a list of message IDs that I can, again, batch process with zmmailbox and mark them as junk.

    I have found the command to mark them as junk (which will also move them into the junk folder, hopefully), but I have not found a way to list all the emails in a given account/folder so that I can filter them and get the IDs.

    Any hints? This is a Debian Etch 32 bits box with ZCS Network Edition 5.0.7 and 1200 accounts from one of my customers.

    Thanks in advance.
    Jaume Sabater
    http://linuxsilo.net/

    "Ubi sapientas ibi libertas"

  2. #2
    Join Date
    Oct 2007
    Location
    Columbus, OH
    Posts
    70
    Rep Power
    8

    Default

    This is a bit time consuming...but the only way I know of to do this is with zmmboxsearch
    Code:
    zmmboxsearch -d /tmp/somedir -m account@domain.com -l25000 -q "in:\"Inbox\""
    This will dump (-d) the messages that match the query (-q) for the mailbox (-m) with a limit of 25000 results returned.

    From there, you will have all the messages in the /tmp/somedir that will be named:
    Sequence#_uuid_messageid
    So, if you were able to fine-tune the problems with the search, you will have all the message ids to get rid of. Otherwise, you will have all messages that you can then go through w/ normal command-line tools, and then make a list of the message IDs that you want to get rid of.

    From that you can then use zmmailbox to operate on the specific message ids. So, if you want to remove items, you can do:
    Code:
    zmmailbox -z -m account@domain.com di itemid itemid itemid

  3. #3
    Join Date
    Mar 2008
    Location
    Palma, Majorca, Balearic Islands, Spain
    Posts
    44
    Rep Power
    7

    Default

    Thanks for the information. I managed to obtain the dump of messages and then, by a lot of greps, cuts, etc, get the IDs and, finally, process them.

    Gotta say that, in the beginning, I was confused and was trying to get it done with the zmmailbox search command, but I could not manage to. Do you know whether this command would do the job that zmmboxsearch did, too?

    Thanks for your help. Very much appreciated.
    Jaume Sabater
    http://linuxsilo.net/

    "Ubi sapientas ibi libertas"

Similar Threads

  1. [SOLVED] How can I delete all emails from a single account?
    By AlanWilliamson in forum Administrators
    Replies: 7
    Last Post: 01-26-2010, 02:01 PM
  2. Test Delete Zimbra account coding
    By fsloke in forum Developers
    Replies: 3
    Last Post: 11-14-2008, 08:08 AM
  3. Replies: 0
    Last Post: 09-13-2008, 11:46 AM
  4. Replies: 3
    Last Post: 08-11-2007, 01:40 PM
  5. Batch Delete
    By bin2hex in forum Users
    Replies: 0
    Last Post: 09-12-2006, 04:05 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
  •