Results 1 to 10 of 10

Thread: imapsync both ways?

  1. #1
    Join Date
    Dec 2007
    Location
    Stockton, CA
    Posts
    164
    Rep Power
    7

    Default imapsync both ways?

    Hi,

    I want some users to test our Zimbra setup before we go live. Unfortunately, the only problem is that imapsync only syncs one way (from our current mail server to our Zimbra server). If I delete a message in Zimbra, the message is not deleted from our mail server and is re-synced back to Zimbra. Also, pretty much any changes that you make over Zimbra don't sync over (sent messages, moved messages, etc.).

    In short, is there a way to have imapsync do a two way sync? Kind-of like the most recent changes apply? I want users to be able to switch between servers and not get things messed up and or confused!

    Thanks!

  2. #2
    Join Date
    May 2007
    Location
    Calgary
    Posts
    62
    Rep Power
    8

    Default

    So sync implies "synchronization."
    So try this, imapsync old server to new server THEN imapsync new server to old server.
    Here is my story:
    I ran imapsync over the weekend to move as much email over the new server from the old server I could, it took 11 hours. Then the next weekend I ran imapsync again from the old server to the new server. What I just did was an incremental update of the emails that changed over that week. It took like an hour.
    This process was good for me because I could delete anything on the new server and even reinstall zimbra until I got the new server running the way i wanted.
    To sync back I would just change the order of the servers in the list of accounts you are changing. imapsync user new user old THEN imapsync user old user new.

    Here is your problem, all the emails that are deleted or moved within folders on one server will reappear on the next server. So I would try to keep this sync between servers to a minimum, or try not to do it.

    Testing before go live idea:
    Run imapsync on a few email accounts to update every 5 min those accounts to the new server. Set the server host name for the test email accounts to be the new server.
    If all fails you can let the users use the old server and their imap folders will update automatically when they log in. You will find their undeleted emails still in their email box.
    If all is good migration starts.


    Testing shouldn't take you too long, maybe a day.

    Cheers

  3. #3
    Join Date
    Dec 2007
    Location
    Stockton, CA
    Posts
    164
    Rep Power
    7

    Default

    That's what I figured I would do.

    I have a pretty gimpy setup, as school districts aren't loaded with money.

    Our current mail server is a nice beefy G5 Xserve. When we move to Zimbra, we're going to wipe it and put Debian on it.

    For testing, I have an older HP NetServer (Dual PIII 933s, 3 GB RAM). Since it only has 2 9 GB drives, I set up our old mail server as an NFS server and mounted the RAID container that way.

    I wanted a processor dedicated to imapsync, so I threw Debian on a 1.25 GHz Mac Mini that I had laying around.

    It works amazingly well. I'm going to set up scripts to run 5 instances of imapsync nightly (to sync all 380+ users), and to run an instance per test user every 5 minutes.

    I had a feeling that I'd have to run imapsync twice if I wanted users to sync both ways. I was hoping that I didn't have to do that (and that there was an argument that told imapsync to sync both ways), but it may not be that big of a deal after all.

  4. #4
    Join Date
    Jan 2008
    Posts
    2
    Rep Power
    7

    Default

    From homepage of offlineimap:
    "... With OfflineIMAP, you can read the same mailbox from multiple computers. You get a current copy of your messages on each computer, and changes you make one place will be visible on all other systems. For instance, you can delete a message on your home computer, and it will appear deleted on your work computer as well..."

    OfflineIMAP

  5. #5
    Join Date
    Jun 2010
    Posts
    2
    Rep Power
    5

    Default

    Hi,

    I just recently install zimbra server, and want to migrate my Firstclass mails into it,
    imapsync can do the job,

    this is what I used for imapsync:
    imapsync --nosyncacls --skipsize --allowsizemismatch --skipheader --syncinternaldates --host1 myfirst.class.com --user1 uploader --password1 'passwd' --host2 zimbra.server.com --user2 su@zimbra.server.ph --password2 'passwd' --authmech2 PLAIN --ssl2 --folderrec 'INBOX' --split1 10 --split2 10
    but it didnt sync both ways. Tried searching the net and found offlineimap, tried it by connecting zimbra and a local mailbox was able to sync, tried it using Firstclass and a local mailbox it prompt for a password and just hangs, so it failed. also tried to sync zimbra and firstclass but no error.

    So the problem here is the Firstclass server connection.
    Im guessing that it could be the authentication method like ssl or cram_md5, or the header size, if it needs to be skipped.

    Has anybody tried offlineimap to migrate FirstClass mail to Zimbra?
    I want to get rid of my FirstClass server.

    Can you help me?

    Thanks in advance.

  6. #6
    Join Date
    Jun 2007
    Location
    BC, Canada
    Posts
    281
    Rep Power
    8

    Default

    You don't want to do a two-way sync. You want to do a one-way sync: from FirstClass into Zimbra.

    However, IMAP support in FC is horribly broken. If you have ever accessed the account using the FC Client, then IMAP will only work on the inbox.

    If you create a new account, copy all the mail folders into it, and then use IMAP to access it, you can access the entire folder list and all messages.

    If you want mostly working, mostly stable, mostly RFC-compliant IMAP access to a FC account, then you can *NEVER* access that account using the FC Client. Doing so will break IMAP access to that account.

    Consider your FC server a data sink, where you can never get the data out of it, and just abandon it. Start fresh with Zimbra.

    You will spend umpteen years and end up bald before you figure out how to extract data from a FC server. They're worse than Microsoft for data lock-in.
    Freddie

  7. #7
    Join Date
    May 2007
    Location
    Calgary
    Posts
    62
    Rep Power
    8

    Default

    My first tip: zmprov is your friend
    Zmprov - Zimbra :: Wiki
    Zmprov Examples - Zimbra :: Wiki

    I have attached some sample files, use these files to help automate your migration from one machine to another. Cut and paste the text from the files into a command line with the zmprov command, this makes things really fast. You will notice that I had the zmprov options included with each line. Again makes things really quick.


    Create domains: createDomain.txt
    Create email accounts: createemailaccounts.txt
    Temp passwords for migration: usertemppasswords.txt
    Replace passwords: replacepassword.txt


    imapsync shell script (remove the txt extension and make the file executable) migrate_accounts.sh.txt
    Edit the imapsync line in the shell script to support your systems.
    I ran the script then looked in my email server logs to find out why things were not working, eg bad passwords, bad authentication, wrong port, wrong password encryption then corrected the imapsync command statement. imapsync also creates a log file so you can look in there for any issues that need to be corrected.
    Just use one email account for testing.

    With this shell script, you want to run it once and let it run for hours or days depending on how many emails there is to migrate.

    Read the log files and fix any account issues.

    NOTE: When you rerun this script it will update only the changes seen in the email accounts, it doesn't over write or copy everything again, it looks for changes only.

    Rerun the shell script just make sure everything is good.

    Now you are set you can run the script the night of the cut over and not have to wait hours or days to copy all the email, just the email that has changed since the sync.

    Run this script again the day of the cut over, the script will propagate any changes from the first time you ran the script. Hopefully its not too much and the script will be finished in an hour or two.


    I personally had to move over 60G of emails with attachments and it took awhile the first time and the cut over night only took 2 hours to propagate the changes.

    Let us know how you make out.

    Good luck.

  8. #8
    Join Date
    May 2007
    Location
    Calgary
    Posts
    62
    Rep Power
    8

    Default

    Make sure that you are using 64bit server with 64bit zimbra, 32bit is being phased out.

    Cheers

  9. #9
    Join Date
    Jun 2007
    Location
    BC, Canada
    Posts
    281
    Rep Power
    8

    Default

    Nice script.

    However, it won't do any good against a FirstClass server, as the IMAP implementation in FC is b0rked beyond repair (and they have no desire to fix it).
    Freddie

  10. #10
    Join Date
    Jun 2010
    Posts
    2
    Rep Power
    5

    Default

    Wow, thanks for the replies!

    I'll try this script, I'll update all of you ASAP.

    Thank You.

Similar Threads

  1. maximizing imapsync speed - parallel runs
    By bewley in forum Migration
    Replies: 4
    Last Post: 09-30-2008, 04:14 PM
  2. problems with imapsync from cyus
    By g8se in forum Migration
    Replies: 3
    Last Post: 02-22-2007, 07:52 PM
  3. imapsync & dovecot
    By PenguinWrangler in forum Migration
    Replies: 3
    Last Post: 01-18-2007, 03:36 PM
  4. imapsync "out of memory"
    By EFSNetworks in forum Administrators
    Replies: 9
    Last Post: 10-13-2006, 02:51 PM
  5. imapsync and mail filters
    By Coilcore in forum Administrators
    Replies: 5
    Last Post: 08-10-2006, 09:21 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
  •