Results 1 to 4 of 4

Thread: [SOLVED] How can I delete a folder in all accounts?

  1. #1
    acasado81 is offline Junior Member
    Join Date
    Aug 2009
    Posts
    7
    Rep Power
    6

    Default [SOLVED] How can I delete a folder in all accounts?

    Hi everybody.

    I am a newbie, and i would like to know how can i delete a folder that it's located in every mailboxes.

    This folder was created when i migrated the mailboxes from MDaemon to Zimbra. This folder is the old trash folder in MDaemon and now it isn't necessary in my new Zimbra server.

    Thanks.



    Release 5.0.18_GA_3011.UBUNTU8_64 UBUNTU8_64 FOSS edition

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,585
    Rep Power
    57

    Default

    You'd need to dump a list of all your accounts then use zmmailbox in a script to remove the offending folder. I believe there are some scripts in the forums that perform similar functions that you could probably hack - I'd suggest trying it on a couple of test accounts before going 'live' and also take a backup before you do.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    alexkelly is offline Trained Alumni
    Join Date
    Oct 2007
    Location
    Columbus, OH
    Posts
    70
    Rep Power
    7

    Default

    I would start by getting a list of all the accounts with zmprov and output those to a file with
    Code:
    zmprov gaa > /tmp/allaccounts
    Then loop through each with zmmailbox with something like:
    Code:
    #!/bin/bash
    DELFOLDER="/Path/of/folder/to/delete"
    for ACCT in $(cat /tmp/allaccounts)
    do
      echo "zmmailbox -z -m $ACCT df \"$DELFOLDER\"">>/tmp/deletefeed
    done
    You should definitely test with a subset of accounts before running over the whole mailbox. Note that in the script I wrote I echoed the zmmailbox commands to a file instead of executing them directly. This allows you to look through and make sure the feed looks right or to remove accounts you don't want to touch prior to executing it.

    Note that you can try this interactively too to ensure you have the right paths set up. run
    Code:
    zmmailbox -z -m account_you_want_to_test
    you will then be at the zmmailbox prompt. You can get a list of all folders with "gaf" or getallfolders and then do df or deletefolder "/Path/to/folder".
    Last edited by alexkelly; 10-25-2009 at 07:12 AM.

  4. #4
    acasado81 is offline Junior Member
    Join Date
    Aug 2009
    Posts
    7
    Rep Power
    6

    Default All folders were deleted successfully

    Thank you for your quickly responses.

    I followed your instructions and wrote a little bash script that delete a folder from all accounts of a domain given in command line.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Can no longer start desktop
    By foobaz in forum General Questions
    Replies: 12
    Last Post: 04-02-2010, 04:06 PM
  2. zimbra opesource Backup Script Problem!
    By tashi in forum Administrators
    Replies: 4
    Last Post: 03-30-2009, 11:49 PM
  3. .pst migration issues
    By jimklein in forum Migration
    Replies: 13
    Last Post: 02-16-2009, 01:55 AM
  4. Error when Using Outlook PST Importer
    By chh in forum Zimbra Connector for Outlook
    Replies: 1
    Last Post: 01-19-2009, 05:20 AM
  5. Replies: 3
    Last Post: 08-11-2007, 12:40 PM

Posting Permissions

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