Results 1 to 5 of 5

Thread: [SOLVED] How to delete data after a spcific data in inbox ?

  1. #1
    marisu is offline Loyal Member
    Join Date
    Aug 2008
    Posts
    87
    Rep Power
    6

    Default [SOLVED] How to delete data after a spcific data in inbox ?

    My zimbra version is 509 . OS is Redhat as 5 .

    My requirement is ,for example , I want to delete the mails which I recivied before oct 20

    in inbox.

    How could i do this with some tools ? I mean not delete them manually.
    Ask Forever...

  2. #2
    Chewie71 is offline Trained Alumni
    Join Date
    Sep 2006
    Location
    Illinois
    Posts
    374
    Rep Power
    8

    Default

    Do you have access to the command line?

    I used some Ruby to do this with Zimbra command line tools...
    Code:
    #Mark and Purge Old Messages
      msg_ids_for_deletion = smb(folder_path, "before:-30days")
      dm(msg_ids_for_deletion)
      msg_ids_for_marking = smb(folder_path, "before:-1day")
      if !msg_ids_for_marking.empty?
        mmr(msg_ids_for_marking)
      end
    I've written some other Ruby that allows me to call Zimbra CLI commands with some parameters, that why I just call
    Code:
    smb(PATH, SEARCH_TERM)
    and
    Code:
    mmr(MSG_IDS)
    and
    Code:
    dm(MSG_IDS)
    ...instead of having to type out the full command.....but in Ruby you can do that with something like this...
    Code:
    msg_ids_for_deletion = `zmprov -z -a ACCOUNT search -l NUM -t message "in:Inbox before:-30days after:-60days"`
    results = `zmprov -z -a ACCOUNT deleteMessage #{msg_ids_for_deletion}`
    ...or something like that anyway. That should search for and find all messages between 30 and 60 days old....and delete them. Test and verify first though as I'm just pulling most of that from memory.

    Matt

  3. #3
    marisu is offline Loyal Member
    Join Date
    Aug 2008
    Posts
    87
    Rep Power
    6

    Default Thanks!

    Thanks for a lot, I have solved this by your way .
    Ask Forever...

  4. #4
    Himanshu is offline Advanced Member
    Join Date
    Jan 2008
    Posts
    223
    Rep Power
    7

    Default

    Quote Originally Posted by marisu View Post
    Thanks for a lot, I have solved this by your way .
    How to I get this ruby stuff..?

  5. #5
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,480
    Rep Power
    56

    Default

    Quote Originally Posted by Himanshu View Post
    How to I get this ruby stuff..?
    Look in the package management system for your distribution or look on-line for some blogs/tutorials on how to do it.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. bayes db..
    By osiris in forum Administrators
    Replies: 9
    Last Post: 06-15-2011, 11:14 AM
  2. [SOLVED] Some problem on attachments!
    By marisu in forum Developers
    Replies: 2
    Last Post: 10-20-2008, 12:54 AM
  3. Replies: 2
    Last Post: 02-12-2008, 11:55 AM
  4. [SOLVED] Delete Mail from inbox
    By krolen in forum Administrators
    Replies: 4
    Last Post: 12-13-2007, 07:29 AM
  5. delete a message in inbox
    By padraig in forum Administrators
    Replies: 3
    Last Post: 05-29-2007, 07:06 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
  •