Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 35

Thread: IMAP Sync and "received" date

  1. #21
    marcdm is offline Junior Member
    Join Date
    Jan 2007
    Posts
    6
    Rep Power
    8

    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

  2. #22
    bobby is offline Zimbra Employee
    Join Date
    Nov 2005
    Posts
    518
    Rep Power
    10

    Default

    good catch. you also have to uncomment this line:

    Code:
    #my $string = $from->message_string($f_msg);

  3. #23
    w1nz is offline Active Member
    Join Date
    Jan 2007
    Posts
    39
    Rep Power
    8

    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.

  4. #24
    Miz
    Miz is offline Intermediate Member
    Join Date
    Jan 2007
    Posts
    19
    Rep Power
    8

    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++;

  5. #25
    sunil_f is offline New Member
    Join Date
    Feb 2007
    Posts
    4
    Rep Power
    8

    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.

  6. #26
    Miz
    Miz is offline Intermediate Member
    Join Date
    Jan 2007
    Posts
    19
    Rep Power
    8

    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.

  7. #27
    sunil_f is offline New Member
    Join Date
    Feb 2007
    Posts
    4
    Rep Power
    8

    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]

  8. #28
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    11

    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!

  9. #29
    sunil_f is offline New Member
    Join Date
    Feb 2007
    Posts
    4
    Rep Power
    8

    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

  10. #30
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,485
    Rep Power
    56

    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


    Acompli: A new adventure for Co-Founder KevinH.

Page 3 of 4 FirstFirst 1234 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to display time and date in "Received" column
    By celeron in forum Administrators
    Replies: 3
    Last Post: 01-28-2009, 02:26 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
  •