Results 1 to 7 of 7

Thread: [SOLVED] Error on renaming and creating aliases accounts

  1. #1
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    5

    Default [SOLVED] Error on renaming and creating aliases accounts

    Hi,
    first of all, congratulations for the great job with Zimbra! I'm new on working with it, and I'm having some problems.
    I'm using the Open Source version, and I need to change users e-mails to new ones, but keeping the old ones as aliases.

    Ex.:


    For example, in case of change user1@oldDomain.com to user1@newDomain.com, I've done the following sequence of commands:
    1. zmprov removeAccountAlias user1@oldDomain.com user1@newDomain.com
    2. zmprov renameAccount user1@oldDomain.com user1@newDomain.com
    3. zmprov deleteAccount user1@oldDomain.com
    4. zmprov addAccountAlias user1@newDomain.com user1@oldDomain.com


    We think that to create an alias to an account, the alias should not exist as a regular email. Because this fact, command 1 and 3 were inserted . We've seen at Wiki page that after renameAccount, zmbackup has to be done, but, as we're using open source version, this command is not available.

    We use this sequence of commands when occurs a change on the users data of our application. The problem #1 is: in some cases, messages are being lost from e-mail accounts, not all, but mainly the ones that were stored in folders. And we believe that the problem is occurring due the renameAccount command, because we can't execute the zmbackup.

    I would like to know if someone could comment our approach, since this issue is really complicated to our team. For trying to restore e-mails to accounts that had errors after the sequence of commands that I presented before, we're doing full copies of /opt/zimbra directory. Problem #2: since just some email boxes are being lost, how could we restore only the messages of a single e-mail account, with the content that is stored in /opt/zimbra?

    Another question: I saw at another thread that renameDomain could be used instead of renameAccount, with the purpose of changing what I related before. Please, does anyone know if is renameDomain more secure than renameAccount in this case?

    Any help will be very appreciated,
    Thanks and best regards,
    Cassia.

  2. #2
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Welcome to the forums

    I do not see why four steps are required. In theory you would
    Code:
    su - zimbra
    zmprov ra user@olddomain.com user@newdomain.com
    zmprov aaa user@newdomain.com user@olddomain.com
    There should be no reason to delete the account as it is a rename and not copy.

  3. #3
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    5

    Default

    Hi,

    I've deleted the account because can occurs the back path, I mean, user1@newDomain.com to user1@oldDomain.com, and I've got an error if I tried to execute just the renameAccount and addAccountAlias directly. But I'm thinking in another strategy because delete an account is causing me serious problems, because are occuring some situations that I did not thought. For example, I forgot to verify if the user1@newDomain.com exists, and if it exists, when doing rename occurs a fail, but I can't get this error from my application script in PHP. So it continues the sequence and deletes the user1@oldDomain.com, and then the user1 is now without any box email

    Please, does anyone know how can I retrieve the messages from a user if I have the full /opt/zimbra folder?

    Starting yesterday, I'm doing backup using the following idea that I found at Wiki Zimbra page:
    http://wiki.zimbra.com/index.php?title=Talk:Backing_up_and_restoring_Zimb ra_%28Open_Source_Version%29

    # get all accounts
    /opt/zimbra/bin/zmprov gaa
    # for each account create a tgz file (export an account)
    /opt/zimbra/bin/zmmailbox -z -m email@domain.com getRestURL "//?fmt=tgz" > "email@domain.com.tgz"

    To import I use zmmailbox with postRestURL.
    Well, after this script, I hope I won't have backup problems anymore, but I really need to recover some accounts messages which I just have backup in /opt/zimbra directory.

    Please, any suggestion?

    Best Regards.
    Last edited by cbatista; 01-20-2010 at 04:17 AM. Reason: Adding more details

  4. #4
    Join Date
    Jun 2008
    Posts
    594
    Rep Power
    8

    Default

    In theory delete account should not work and should give error as that account no longer exist and is being renamed to newaccount.
    What ubox suggest is the approach you can follow and if you face any issues then you can post the error messages.

  5. #5
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    5

    Default

    Hi Veronica, thanks your answer.

    The problem I've got when doing ubox suggestion occurs when I have to do the "path back", which I describe in my earlier post.

    When back from user1@newDomain.com to user1@oldDomain.com, using
    ra user1@newDomain.com user1@oldDomain.com
    I've got the fail:
    ERROR: account.ACCOUNT_EXISTS (email address already exists: user1@oldDomain.com).

    At this point, user1@oldDomain.com is an alias of user1@newDomain.com, then probably this is the error. Because of this fact, I tried to do the 4 commands: raa, ra, da and aaa.

    And I'm still trying to recover some account messages that I've lost doing this approach, since I just have backup of the full /opt/zimbra folder.

    Regards.
    Last edited by cbatista; 01-20-2010 at 05:47 AM. Reason: Adding more details

  6. #6
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Why are you having to rename back ? If you need to then just remove the alias, rename the account, and then add the original alias back in.

  7. #7
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    5

    Default

    Hi uxbod,

    I work at an university and emails must reflect the department where employees are located. And there are people that change as a certain frequency, so I have to rename email back. But I tried the way you told me, without delete the account and it works. Thanks a lot!

Posting Permissions

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