Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Error importing via zmmailbox

  1. #1
    The Fold is offline Senior Member
    Join Date
    Mar 2007
    Location
    London, UK
    Posts
    50
    Rep Power
    8

    Default Error importing via zmmailbox

    So not having had much luck with the perl or python scripts on the wiki I found a script here that converted my MBOX files to maildir, I have then been able to upload to different people's mailboxes with the command:

    Code:
    zmmailbox -z -m <user>
    createFolder /Imported
    addMessage Imported /tmp/oldmail/.maildir/cur
    However, when using this method I found that I received a message saying

    Code:
    ERROR: service.FAILURE (system failure: Failure Indexing: com.zimbra.cs.mailbox.Appointment@1e29df9)
    on one occasion. This was about 700 messages in out of 1655 messages. As it imports them in a seemingly random order I have no idea which message this would have been as they are all labelled in numerical order and the import looks like:

    Code:
    ...
    694 (/tmp/migration/test2/.old_MBX/cur/1208526616.000833.mbox:2,)
    695 (/tmp/migration/test2/.old_MBX/cur/1208526616.000143.mbox:2,)
    696 (/tmp/migration/test2/.old_MBX/cur/1208526616.000879.mbox:2,)
    697 (/tmp/migration/test2/.old_MBX/cur/1208526616.000783.mbox:2,)
    698 (/tmp/migration/test2/.old_MBX/cur/1208526616.000600.mbox:2,)
    699 (/tmp/migration/test2/.old_MBX/cur/1208526616.000790.mbox:2,)
    700 (/tmp/migration/test2/.old_MBX/cur/1208526616.000748.mbox:2,)
    701 (/tmp/migration/test2/.old_MBX/cur/1208526616.000882.mbox:2,)
    702 (/tmp/migration/test2/.old_MBX/cur/1208526616.000551.mbox:2,)
    703 (/tmp/migration/test2/.old_MBX/cur/1208526616.000660.mbox:2,)
    704 (/tmp/migration/test2/.old_MBX/cur/1208526616.001155.mbox:2,)
    705 (/tmp/migration/test2/.old_MBX/cur/1208526616.000559.mbox:2,)
    706 (/tmp/migration/test2/.old_MBX/cur/1208526616.000348.mbox:2,)
    707 (/tmp/migration/test2/.old_MBX/cur/1208526616.000347.mbox:2,)
    708 (/tmp/migration/test2/.old_MBX/cur/1208526616.000850.mbox:2,)
    709 (/tmp/migration/test2/.old_MBX/cur/1208526616.000925.mbox:2,)
    710 (/tmp/migration/test2/.old_MBX/cur/1208526616.000028.mbox:2,)
    711 (/tmp/migration/test2/.old_MBX/cur/1208526616.000663.mbox:2,)
    712 (/tmp/migration/test2/.old_MBX/cur/1208526616.000060.mbox:2,)
    713 (/tmp/migration/test2/.old_MBX/cur/1208526616.000159.mbox:2,)
    ...
    I thought it might be date order but those last 2 messages are both in August but one is 2006, the other is 2007.

    Now I can get the messages in to the persons Inbox via the aforementioned Python script but obviously it makes it easier to automate if I can do it all in one run this way.

  2. #2
    webman's Avatar
    webman is offline Special Member
    Join Date
    Oct 2007
    Location
    North East England
    Posts
    167
    Rep Power
    7

    Default

    I'm not sure why that script isn't working, but like you, I also had no luck with the MBOX scripts on the wiki.

    However, I found one on the forum here, and made a few modifications which allowed me to run it on an individual mailbox - this also had the advantage I could do several at a time using virtual terminals/screen sessions to the linux box. I have migrated over 100 accounts using this script and only had a handful of missing messages.

    MBOX to Zimbra.

    Directory structure is accepted to be like this:

    Code:
    /tmp/migrate/craig.rodway/mail/Drafts
    /tmp/migrate/craig.rodway/mail/Sent
    /tmp/migrate/craig.rodway/mail/Trash
    /tmp/migrate/craig.rodway/mail/Inbox
    Usage:

    Code:
    mailimport.pl username
    As that script replaces spaces with underscores in mail directory names I created another script to run after import to change them back to spaces.

    Zimbra mailbox - underscores to spaces

    Usage:

    Code:
    fixfolders.pl username
    Hope this helps.

  3. #3
    The Fold is offline Senior Member
    Join Date
    Mar 2007
    Location
    London, UK
    Posts
    50
    Rep Power
    8

    Default

    Thanks for that script, I'm importing mail with zero fuss as we speak!

    The only things I would like to mention is that your script has your e-mail domain listed in it, and for some reason having my mail in /tmp/migrate/user/mail didn't seem to work, it was fine though if I just moved the files to /tmp/mail/user/mail, so maybe a section to add in a parameter on the command line for it?

    Also the speed seems slow but I guess if it re-opens zmmailbox for each message then that would explain it.

    Other than that it works great! Shame this isn't on the wiki.

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

    Default

    Quote Originally Posted by The Fold View Post
    Other than that it works great! Shame this isn't on the wiki.
    The wiki is a Community resource, feel free to add the script to the wiki if you want.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  5. #5
    webman's Avatar
    webman is offline Special Member
    Join Date
    Oct 2007
    Location
    North East England
    Posts
    167
    Rep Power
    7

    Default

    Hi The Fold

    No problem at all.. as I said, it's a script I found on the forum which I had to modify a bit to get to work with the way I was migrating; but I'm pleased it's been of some help to you

    Yes unfortunately it is fairly slow due to it's nature - it took me about a week (working about 12 hour days) to migrate 130 accounts of varying sizes - a lot were around the 500MB mark. It puzzled me how the PST Import Wizard could process dozens of messages per second where this script could average 1 per second but I guess it's just the code that zmmailbox uses

    If nobody beats me to it I'll do some tidying up and then add it to the wiki.
    Last edited by webman; 04-21-2008 at 05:40 AM.

  6. #6
    The Fold is offline Senior Member
    Join Date
    Mar 2007
    Location
    London, UK
    Posts
    50
    Rep Power
    8

    Default

    This is just a thought, but would it not be possible to modify the script so that it converts all the e-mail first for a folder then performs a zmmailbox addMessage against that whole folder?

    I'm no perl expert by any means but if the line...

    Code:
    system ("/opt/zimbra/bin/zmmailbox -z -m $user addmessage  /$dirname /tmp/$user/$dirname/mail_$dirname$count.txt");
    were moved just outside of the $msg loop and adjusted to read

    Code:
    system ("/opt/zimbra/bin/zmmailbox -z -m $user addmessage  /$dirname /tmp/$user/$dirname/;
    would that not mean it would upload the whole folder?

  7. #7
    webman's Avatar
    webman is offline Special Member
    Join Date
    Oct 2007
    Location
    North East England
    Posts
    167
    Rep Power
    7

    Default

    I'm not sure if that will work but it's worth a try. I would recommend creating a test account first, then run the command manually as the Zimbra user against the test account with one of the directories as input.

    The help suggests it is possible, however:

    Code:
    addMessage(am)               [opts] {dest-folder-path} {filename-or-dir} [{filename-or-dir} ...
    Last edited by webman; 04-21-2008 at 07:13 AM.

  8. #8
    The Fold is offline Senior Member
    Join Date
    Mar 2007
    Location
    London, UK
    Posts
    50
    Rep Power
    8

    Default

    It is possible, and altering the script so like so

    Code:
                                print "----Done processing message, stored in mail_$dirname$count.txt----\n\n";
                            }       # end if subject not internal data
    
                    }       # end of for $msg
    
            system ("/opt/zimbra/bin/zmmailbox -z -m $user addmessage  /$dirname /tmp/$user/$dirname/");
    
            }       # end of flagset=1
    does work, I tested it with a couple of mailboxes without issue. However, if you were to encounter an error like I listed in my first post it stops importing for that folder altogether and moves on to the next folder.

    I've re-adjusted my script back so that it's uploading on a per-message basis and logging the output so I can see which message is causing the error.

  9. #9
    webman's Avatar
    webman is offline Special Member
    Join Date
    Oct 2007
    Location
    North East England
    Posts
    167
    Rep Power
    7

    Default

    Cool, thanks - that's good to know

    Another thing - sometimes you may find it will appear to freeze on a message. This isn't anything to worry about - it seems that the Mailbox Purge background process begins to run on the account once you start importing messages, but the script will soon carry on.

  10. #10
    The Fold is offline Senior Member
    Join Date
    Mar 2007
    Location
    London, UK
    Posts
    50
    Rep Power
    8

    Default

    I've now found the message that was causing the error, it was a message that was forwarded, contained some appointment details and also an attachment. I don't know if this combination of different types is why it won't import?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 03-24-2008, 02:35 PM
  2. Sharing calendars to group with zmmailbox - permission denied
    By smcgrath1111 in forum Administrators
    Replies: 1
    Last Post: 01-24-2008, 03:08 PM
  3. zmmailbox and spaces in folder names
    By badrian in forum Administrators
    Replies: 2
    Last Post: 06-28-2007, 11:26 AM
  4. zmmailbox command help
    By markpr in forum Administrators
    Replies: 2
    Last Post: 03-19-2007, 09:13 AM
  5. zmmailbox createfolder command options
    By shideg in forum Migration
    Replies: 3
    Last Post: 12-12-2006, 08:25 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
  •