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

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
  #21 (permalink)  
Old 01-22-2007, 05:11 PM
Junior Member
 
Posts: 6
Default

Quote:
Originally Posted by bobby View Post
can't you just uncomment the append_string line that's already there?

Code:
#unless($new_id = $to->append_string($t_fold,$string, $flags_f, $d)){
unless($new_id = $to->append_file($t_fold, $message_file, $flags_f, $d)){
I don't really know Perl and I wasn't sure on the origins of the variable named $string that's why I created my own named $mmstr
Reply With Quote
  #22 (permalink)  
Old 01-24-2007, 12:58 PM
Zimbra Employee
 
Posts: 515
Default

good catch. you also have to uncomment this line:

Code:
#my $string = $from->message_string($f_msg);
__________________
Search the Forums - Bugzilla - Wiki - Downloads
Reply With Quote
  #23 (permalink)  
Old 01-25-2007, 02:00 PM
Active Member
 
Posts: 39
Default

First of all, in my case, the lines this section of the coding was on was different, not 1123. It may be different for other people as well so be aware of this. Second, the ONLY way I could get this to work is if I made that section look EXACTLY like what marcdm had posted. Hope that helps. I wouldn't try anything else if you want this to work, just make it look exactly like marcdm's last post.

Thanks for that bit of info marcdm, helped me out a lot.
Reply With Quote
  #24 (permalink)  
Old 01-26-2007, 03:34 PM
Miz Miz is offline
Intermediate Member
 
Posts: 19
Default

I tried Bobby's solution, worked a treat.

Changed
Code:
#my $string = $from->message_string($f_msg);
to this
Code:
my $string = $from->message_string($f_msg);
and changed
Code:

#unless($new_id = $to->append_string($t_fold,$string, $flags_f, $d)){
unless($new_id = $to->append_file($t_fold, $message_file, $flags_f, $d)){
to this
Code:

unless($new_id = $to->append_string($t_fold,$string, $flags_f, $d)){
#unless($new_id = $to->append_file($t_fold, $message_file, $flags_f, $d)){

Or for the geeks in the audience, here's a patch:

Code:
# diff -u /usr/bin/imapsync.orig /usr/bin/imapsync
--- /usr/bin/imapsync.orig      2007-01-26 17:18:13.000000000 -0500
+++ /usr/bin/imapsync   2007-01-26 17:33:34.000000000 -0500
@@ -1078,7 +1078,7 @@
                        # copy
                        print "+ Copying msg #$f_msg:$f_size to folder $t_fold\n";
                        last FOLDER if $from->IsUnconnected();
-                       #my $string = $from->message_string($f_msg);
+                       my $string = $from->message_string($f_msg);
                        my $message_file = "tmp_imapsync_$$";
                        unlink($message_file);
                        $from->message_to_file($message_file, $f_msg);
@@ -1111,8 +1111,8 @@
                        print "flags from : [$flags_f][$d]\n";
                        last FOLDER if   $to->IsUnconnected();
                        unless ($dry) {
-                               #unless($new_id = $to->append_string($t_fold,$string, $flags_f, $d)){
-                               unless($new_id = $to->append_file($t_fold, $message_file, $flags_f, $d)){
+                               unless($new_id = $to->append_string($t_fold,$string, $flags_f, $d)){
+                               #unless($new_id = $to->append_file($t_fold, $message_file, $flags_f, $d)){
                                        warn "Couldn't append msg #$f_msg (Subject:[".$from->subject($f_msg)."]) to folder $t_fold: ",
                                          $to->LastError, "\n";
                                        $error++;
Reply With Quote
  #25 (permalink)  
Old 02-01-2007, 12:39 AM
New Member
 
Posts: 4
Default Size error while syncing

Hi,

I changed the above lines in my imapsync, i get the following error while syncing

+ NO msg #70 [mjmLeWsKuCobPVWzqs4BUQ:172] in Inbox
+ Copying msg #70:172 to folder Inbox
Mail::IMAPClient=HASH(0x9457e48)::message_string: expected 172 bytes but received 1574 at /usr/bin/imapsync line 1081
flags from : [\Seen]["28-Sep-2005 03:55:19 +0000"]
Copied msg id [70] to folder Inbox msg id [440]
+ NO msg #73 [D6W9P5sVrTdBvRJdZ0LP4g:172] in Inbox
+ Copying msg #73:172 to folder Inbox
Mail::IMAPClient=HASH(0x9457e48)::message_string: expected 172 bytes but received 1588 at /usr/bin/imapsync line 1081

Because of this attachments are not being synced properly,

thanks,

Sunil

Last edited by sunil_f; 02-01-2007 at 12:57 AM..
Reply With Quote
  #26 (permalink)  
Old 02-01-2007, 06:38 AM
Miz Miz is offline
Intermediate Member
 
Posts: 19
Default

Hi.

The imapsync documentation is pretty good.
You're missing an option it seems.

Here's the line that worked the way I needed it to. I believe you're just missing the --skipsizes option.

Please be aware that the below line will not work as-is for you. You'd have to understand and change everything, including realising that all the mail will keep the folder-structure of your source, but that it will all be created in a subfolder from the root.

Code:
imapsync --regextrans2 's/(.*)/importedmail\/$1/' --nosyncacls --syncinternaldates --authmech1 PLAIN --ssl1 --authmech2 PLAIN --ssl2  --host1 source.domain.tld --user1 myusername --password1 "long long password" --host2 destination.zimbraenabled.otherdomain.tld --user2 myusername --password2 shortpassword --skipsize --nofoldersizes 2>1 | tee imapsync.log
The above example also assumes your folders are set up to be separated by the UNIX separator ('/') on the destination machine and not dots. Zimbra's (the machine you're likely transferring to -- the destination's) default appears to be /. imapsync should take care of recognizing dotted or "slashed" folder separators on the source without you needing to do anything.

Last edited by Miz; 02-01-2007 at 06:42 AM..
Reply With Quote
  #27 (permalink)  
Old 02-01-2007, 11:30 PM
New Member
 
Posts: 4
Default Still the same error

Hi Miz,

I tried adding the options you told "--skipsize --nofoldersizes" but am still getting the same error, this is after i add the above mentioned lines in /usr/bin/imapsync. If i remove those lines it doesn't throw up the error but the dates get messed up.

Am pasting my imapsync script that i use..

imapsync $1 --nosyncacls --skipsize --nofoldersizes --syncinternaldates --authmech1 PLAIN --authmech2 PLAIN --ssl2 \
--exclude "#KnownSpam" --exclude "#FalsePositives" \
--exclude "Trash" --exclude "Deleted Items" \
--exclude "Deleted Messages" --exclude "Deleted" \
--host1 $host1 --user1 "$user" --password1 "$p1" \
--host2 $host2 --user2 "$user2" --password2 "$p2" | tee imapsync.log


error thrown is

+ NO msg #163 [Ls+xAHKt5FyPxNpNHbBBPQ] in Inbox
+ Copying msg #163:171 to folder Inbox
Mail::IMAPClient=HASH(0x8f3ae48)::message_string: expected 171 bytes but received 1157478 at /usr/bin/imapsync line 1081
flags from : [\Seen]["08-Mar-2006 19:00:32 +0000"]
Copied msg id [163] to folder Inbox msg id [309]
Reply With Quote
  #28 (permalink)  
Old 02-01-2007, 11:42 PM
Zimbra Employee
 
Posts: 1,434
Default Which version of imapsync?

Don't use imapsync version 1.200 or later unless you've applied the patch from earlier in the thread. Earlier versions should work fine.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #29 (permalink)  
Old 02-02-2007, 03:17 AM
New Member
 
Posts: 4
Default Still the same error

Quote:
Originally Posted by dkarp View Post
Don't use imapsync version 1.200 or later unless you've applied the patch from earlier in the thread. Earlier versions should work fine.
Yes i have applied the patch and my version is 1.201, If i apply the patch the above error appears, if i don't apply the patch the dates get messed up,

I am running on a tight schedule for the migration and these issues are slowing it down.

thanks,

Sunil
Reply With Quote
  #30 (permalink)  
Old 02-02-2007, 03:24 AM
Zimbra Consultant & Moderator
 
Posts: 19,653
Default

Quote:
Originally Posted by sunil_f View Post
Yes i have applied the patch and my version is 1.201, If i apply the patch the above error appears, if i don't apply the patch the dates get messed up,
What, the exact same message? Does it always fail on the same message? What happens if you move that message out of the way? Have you tried an earlier version of imapsync?

Quote:
Originally Posted by sunil_f View Post
I am running on a tight schedule for the migration and these issues are slowing it down.
That's why people are doing their best to help you.
__________________
Regards


Bill
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

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.