Results 1 to 4 of 4

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

  1. #1
    Join Date
    Aug 2009
    Rep Power

    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.


    Release 5.0.18_GA_3011.UBUNTU8_64 UBUNTU8_64 FOSS edition

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Vannes, France
    Rep Power


    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.


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    Join Date
    Oct 2007
    Columbus, OH
    Rep Power


    I would start by getting a list of all the accounts with zmprov and output those to a file with
    zmprov gaa > /tmp/allaccounts
    Then loop through each with zmmailbox with something like:
    for ACCT in $(cat /tmp/allaccounts)
      echo "zmmailbox -z -m $ACCT df \"$DELFOLDER\"">>/tmp/deletefeed
    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
    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
    Join Date
    Aug 2009
    Rep Power

    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.

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, 12:55 AM
  4. Error when Using Outlook PST Importer
    By chh in forum Zimbra Connector for Outlook
    Replies: 1
    Last Post: 01-19-2009, 04: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