Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: delete messages massively

  1. #1
    maumar is offline Elite Member
    Join Date
    Mar 2007
    Location
    Small village in the center of Italy
    Posts
    348
    Rep Power
    8

    Default delete messages massively

    i have a mailbox containing 855k messages; of these, 200k are Cron Daemon warning messages and i would wipe them out.
    I am searching for way to do it easily, without any success
    Any advice will be (as u can imagine) very apreciated

    Maurizio

  2. #2
    Costa-101's Avatar
    Costa-101 is offline Project Contributor
    Join Date
    Sep 2006
    Location
    Space station 101
    Posts
    182
    Rep Power
    8

    Lightbulb

    Why not log into webmail - create a folder called Ready_for_trash, then create a filter that moves all your cron errors to the folder.

    Then drag the folder to the trash and empty the bin !!
    ------------------------------
    http://www.lcrm.co.uk

  3. #3
    maumar is offline Elite Member
    Join Date
    Mar 2007
    Location
    Small village in the center of Italy
    Posts
    348
    Rep Power
    8

  4. #4
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    11

    Default

    You should be able to script the zmmailbox utility. First, use zmmailbox search to find the messages you want to remove. Then use zmmailbox deleteMessages to delete them.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  5. #5
    maumar is offline Elite Member
    Join Date
    Mar 2007
    Location
    Small village in the center of Italy
    Posts
    348
    Rep Power
    8

    Default

    Quote Originally Posted by dkarp View Post
    You should be able to script the zmmailbox utility. First, use zmmailbox search to find the messages you want to remove. Then use zmmailbox deleteMessages to delete them.
    something like
    #! /bin/bash

    for i in `zmmailbox search "(From:Cron)"`
    do
    zmmailbox deleteMessages $i
    done

    i suppose

  6. #6
    maumar is offline Elite Member
    Join Date
    Mar 2007
    Location
    Small village in the center of Italy
    Posts
    348
    Rep Power
    8

    Default

    Quote Originally Posted by dkarp View Post
    You should be able to script the zmmailbox utility. First, use zmmailbox search to find the messages you want to remove. Then use zmmailbox deleteMessages to delete them.
    ok, it seems to work

    for i in `zmmailbox -z -m maumar_at_xxx.xx search NOD32| grep conv| cut -b 6-9` ;do echo $i;zmmailbox -z -m maumar_at_xxx.xx dm $i ; done

    last question: i would be glad if search command could retuns more than 20 messages at a time
    how can do it?

    tia
    Last edited by maumar; 02-20-2008 at 05:33 AM.

  7. #7
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    11

    Default

    -l {max number of results to return}
    Bugzilla - Wiki - Downloads - Before posting... Search!

  8. #8
    maumar is offline Elite Member
    Join Date
    Mar 2007
    Location
    Small village in the center of Italy
    Posts
    348
    Rep Power
    8

    Default

    Quote Originally Posted by maumar View Post
    ok, it seems to work

    for i in `zmmailbox -z -m maumar_at_xxx.xx search NOD32| grep conv| cut -b 6-9` ;do echo $i;zmmailbox -z -m maumar_at_xxx.xx dm $i ; done

    last question: i would be glad if search command could retuns more than 20 messages at a time
    how can do it?

    tia
    better:

    grep conv | cut -d '-' -f 2 | cut -d ' ' -f 1

  9. #9
    atlee is offline Active Member
    Join Date
    Oct 2007
    Location
    Santa Rosa. CA
    Posts
    40
    Rep Power
    7

    Default Suggested solution doesn't work

    zmmailbox -z -m admin@corp.com search "(Subject:Service /dev/mapper/VolGroup_ID_30963-LogVol1 started on zimbra.corp.com)" | grep conv | cut -d '-' -f 2 | cut -d ' ' -f 1

    Works like a champ pruning the search to a list of message IDs only. putting that string in a for loop whose output is run through zmmailbox, however, does not work.

    for i in 'zmmailbox -z -m admin@corp.com search "(Subject:Service /dev/mapper/VolGroup_ID_30963-LogVol1 started on zimbra.corp.com)" | grep conv | cut -d '-' -f 2 | cut -d ' ' -f 1'; do echo $i; zmmailbox -z -m admin@zimbra.corp.com dm $i; done

    Zmmailbox dm help is displayed twice, first for the search command through "cut -d", and then for "-f 1". Is this something about nested quotes in bash, or is it a zmmailbox quirk?

    I redirected the search output to a file, and ran a for loop against the file of message IDs (this had no nested quotes), and I still got help output and no deletions.

  10. #10
    maumar is offline Elite Member
    Join Date
    Mar 2007
    Location
    Small village in the center of Italy
    Posts
    348
    Rep Power
    8

    Default

    sorry, it's not clear what have u done and if u were able to delete messages
    -m

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Re-creating the spam training e-mail account
    By richard-hdd in forum Administrators
    Replies: 21
    Last Post: 03-20-2012, 07:34 AM
  2. Delete all messages
    By norixam in forum Administrators
    Replies: 2
    Last Post: 01-07-2008, 07:05 AM
  3. Delete messages from store
    By claros in forum Administrators
    Replies: 2
    Last Post: 10-21-2006, 06:45 PM
  4. Spam assassain not traiing properly!
    By Mike T in forum Administrators
    Replies: 1
    Last Post: 10-09-2006, 01:34 PM
  5. Can't delete messages in Outlook Express
    By mond in forum Administrators
    Replies: 2
    Last Post: 10-05-2006, 02:01 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
  •