Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-18-2010, 05:06 PM
New Member
 
Posts: 4
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.
Reply With Quote
  #2 (permalink)  
Old 01-18-2010, 06:31 PM
Moderator
 
Posts: 7,928
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.
__________________
Reply With Quote
  #3 (permalink)  
Old 01-20-2010, 02:51 AM
New Member
 
Posts: 4
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 03:17 AM.. Reason: Adding more details
Reply With Quote
  #4 (permalink)  
Old 01-20-2010, 03:02 AM
Outstanding Member
 
Posts: 594
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.
Reply With Quote
  #5 (permalink)  
Old 01-20-2010, 04:42 AM
New Member
 
Posts: 4
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 04:47 AM.. Reason: Adding more details
Reply With Quote
  #6 (permalink)  
Old 01-20-2010, 06:01 AM
Moderator
 
Posts: 7,928
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.
__________________
Reply With Quote
  #7 (permalink)  
Old 01-21-2010, 03:17 AM
New Member
 
Posts: 4
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!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.