View Single Post
  #24 (permalink)  
Old 01-26-2007, 02: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