1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-16 15:52:47 +01:00
This commit is contained in:
Nick Bebout 2011-03-12 02:44:37 +00:00
parent c739d9e680
commit 2ab8a06dbc
10 changed files with 36516 additions and 39 deletions

View File

@ -1,17 +1,25 @@
RCS file: RCS/imapsync,v
Working file: imapsync
head: 1.250
head: 1.252
branch:
locks: strict
gilles: 1.250
gilles: 1.252
access list:
symbolic names:
keyword substitution: kv
total revisions: 250; selected revisions: 250
total revisions: 252; selected revisions: 252
description:
----------------------------
revision 1.250 locked by: gilles;
revision 1.252 locked by: gilles;
date: 2008/05/08 02:30:17; author: gilles; state: Exp; lines: +36 -6
Added mailing list information.
----------------------------
revision 1.251
date: 2008/05/08 02:08:44; author: gilles; state: Exp; lines: +56 -14
Fixed message_string returning empty message when < expected size.
----------------------------
revision 1.250
date: 2008/04/21 03:46:01; author: gilles; state: Exp; lines: +11 -7
Bug fix "parse_headers want an ARRAY ref"
----------------------------

7
FAQ
View File

@ -86,6 +86,11 @@ b) Use the --syncinternaldates option and keep using Eudora :-)
c) Use the script learn/adjust_time.pl to change the internal dates
from the "Date:" header.
=======================================================================
Q. The option --subscribe does not seem to work
R. Use it with --subscribed
=======================================================================
Q. Does imapsync retain the \Answered and $Forwarded flags?
@ -549,7 +554,7 @@ R. GroupWise 7 seems buggy. Apply GroupWise 7 support pack 1
Q. Migrating from David Tobit V8
R. Use the following options :
imapsync ... --prefix1 INBOX. --sep1 / --subscribe
imapsync ... --prefix1 INBOX. --sep1 / --subscribe --subscribed
=======================================================================
Q. I need to migrate 1250 mailboxes from one cyrus-IMAP server to another

35
README
View File

@ -3,7 +3,7 @@ NAME
Synchronise mailboxes between two imap servers. Good at IMAP migration.
More than 32 different IMAP server softwares supported with success.
$Revision: 1.250 $
$Revision: 1.252 $
INSTALL
imapsync works fine under any Unix OS with perl.
@ -175,9 +175,36 @@ LICENSE
General Public License. See the GPL file included in the distribution or
the web site http://www.gnu.org/licenses/licenses.html
MAILING-LIST
Here is the welcome message:
Welcome on the imapsync mailing-list.
This list is dedicated to the users of imapsync
http://www.linux-france.org/prj/imapsync/
To write on the list, the address is: mailto:imapsync@linux-france.org
To unsubscribe, send a message to:
mailto:imapsync-unsubscribe@listes.linux-france.org
To subscribe, send a message to:
mailto:imapsync-subscribe@listes.linux-france.org
To contact the person in charge for the list:
mailto:imapsync-request@listes.linux-france.org
The list archives may be available at:
http://www.linux-france.org/prj/imapsync_list/ So consider that the list
is public, anyone can see your post. Use a pseudonym or do not post to
this list if you want to stay private.
Thank you for your participation.
BUGS
No known serious bug. Report any bug to the author. Before reporting
bugs, read the FAQ, this README and the TODO files.
No known serious bug. Report any bug or feature request to the author or
the mailing-list. Before reporting bugs, read the FAQ, this README and
the TODO files.
Don't write imapsync in uppercase in the email title, I'll know you run
windows.
@ -333,5 +360,5 @@ SIMILAR SOFTWARES
Feedback (good or bad) will be always welcome.
$Id: imapsync,v 1.250 2008/04/21 03:46:01 gilles Exp gilles $
$Id: imapsync,v 1.252 2008/05/08 02:30:17 gilles Exp gilles $

1
TODO
View File

@ -1,6 +1,7 @@
TODO file for imapsync
----------------------
Add kerberos authentification
Add NOOP commands to avoid timeouts.

View File

@ -1 +1 @@
1.250
1.252

View File

@ -16,6 +16,6 @@ RELEASE_FOCUS="Major bugfixes"
#TEXT_BODY="Bug fix: rewrote the way to store messages to avoid freeze problems with some imap servers"
#TEXT_BODY="Bug fix: Allow long usernames with md5 authentification."
TEXT_BODY="Bug fixes:
- Bug fix to the "parse_headers want an ARRAY ref" crash.
- Bug really fixed: "parse_headers want an ARRAY ref" crash (second time).
- Many thanks to the freshmeat folk that correct my bad and poorly English !
"

View File

@ -1,18 +1,9 @@
Project: imapsync
Version: 1.249
Release-Focus: Minor feature enhancements
Version: 1.250
Release-Focus: Major bugfixes
Hide: N
Home-Page-URL: http://www.linux-france.org/prj/imapsync/
Gzipped-Tar-URL: http://www.linux-france.org/prj/imapsync/dist/
Bug fixes:
- Turned on --syncinternaldates option by default.
- Set timezone TZ=GMT if no timezone is set (MSWindows bug).
- Ignore message when it has no header.
- Added message id in output warning when no header found.
- Removed public freshmeat annoucement access since 1.241 was not mine (no problem) and not correct (problem).
- Can run with IMAPClient_3.x.x without redefine any function (but 3.x.x is still buggy and to be avoided)
- Started unit tests.
- Many thanks to the freshmeat folk that correct my bad and poorly English !

102
imapsync
View File

@ -9,7 +9,7 @@ tool. Synchronise mailboxes between two imap servers. Good
at IMAP migration. More than 32 different IMAP server softwares
supported with success.
$Revision: 1.250 $
$Revision: 1.252 $
=head1 INSTALL
@ -205,9 +205,39 @@ the GNU General Public License. See the GPL file included in
the distribution or the web site
http://www.gnu.org/licenses/licenses.html
=head1 MAILING-LIST
Here is the welcome message:
Welcome on the imapsync mailing-list.
This list is dedicated to the users of imapsync
http://www.linux-france.org/prj/imapsync/
To write on the list, the address is:
mailto:imapsync@linux-france.org
To unsubscribe, send a message to:
mailto:imapsync-unsubscribe@listes.linux-france.org
To subscribe, send a message to:
mailto:imapsync-subscribe@listes.linux-france.org
To contact the person in charge for the list:
mailto:imapsync-request@listes.linux-france.org
The list archives may be available at:
http://www.linux-france.org/prj/imapsync_list/
So consider that the list is public, anyone
can see your post. Use a pseudonym or do not
post to this list if you want to stay private.
Thank you for your participation.
=head1 BUGS
No known serious bug. Report any bug to the author.
No known serious bug. Report any bug or feature request to the author
or the mailing-list.
Before reporting bugs, read the FAQ, this README and the
TODO files.
@ -387,7 +417,7 @@ Entries for imapsync:
Feedback (good or bad) will be always welcome.
$Id: imapsync,v 1.250 2008/04/21 03:46:01 gilles Exp gilles $
$Id: imapsync,v 1.252 2008/05/08 02:30:17 gilles Exp gilles $
@ -452,7 +482,7 @@ my(
use vars qw ($opt_G); # missing code for this will be option.
$rcs = ' $Id: imapsync,v 1.250 2008/04/21 03:46:01 gilles Exp gilles $ ';
$rcs = ' $Id: imapsync,v 1.252 2008/05/08 02:30:17 gilles Exp gilles $ ';
$rcs =~ m/,v (\d+\.\d+)/;
$VERSION = ($1) ? $1 : "UNKNOWN";
@ -486,8 +516,8 @@ $error=0;
my $banner = join("",
'$RCSfile: imapsync,v $ ',
'$Revision: 1.250 $ ',
'$Date: 2008/04/21 03:46:01 $ ',
'$Revision: 1.252 $ ',
'$Date: 2008/05/08 02:30:17 $ ',
"\n",localhost_info(),
" and the module Mail::IMAPClient version used here is ",
$VERSION_IMAPClient,"\n",
@ -2192,14 +2222,16 @@ use constant NonFolderArg => 1; # Value to pass to Massage to
my($self,$msgspec_all,@fields) = @_;
my(%fieldmap) = map { ( lc($_),$_ ) } @fields;
my $msg; my $string; my $field;
if(ref($msgspec_all) eq 'HASH') {
$msgspec_all = [$msgspec_all];
}
#print ref($msgspec_all), "\n";
#if(ref($msgspec_all) eq 'HASH') {
# print ref($msgspec_all), "\n";
#$msgspec_all = [$msgspec_all];
#}
unless(ref($msgspec_all) eq 'ARRAY') {
print "parse_headers want an ARRAY ref\n";
exit 1;
#exit 1;
return undef;
}
my $headers = {}; # hash from message ids to header hash
@ -2278,22 +2310,28 @@ use constant NonFolderArg => 1; # Value to pass to Massage to
my $hdr = $header;
chomp $hdr;
$hdr =~ s/\r$//;
#print "W[$hdr]\n";
if (defined($hdr) and $hdr =~ s/^(\S+):\s*//) {
#print "X";
#print "W[$hdr]", ref($hdr), "!\n";
#next if ( ! defined($hdr));
#print "X[$hdr]\n";
if (defined($hdr) and ($hdr =~ s/^(\S+):\s*//)) {
# if ($hdr =~ s/^(\S+):\s*//) {
#print "X1\n";
$field = exists $fieldmap{lc($1)} ? $fieldmap{lc($1)} : $1 ;
push @{$h->{$field}} , $hdr ;
} elsif ($hdr =~ s/^.*FETCH\s\(.*BODY\[HEADER\.FIELDS.*\)\]\s(\S+):\s*//) {
#print "X2\n";
$field = exists $fieldmap{lc($1)} ? $fieldmap{lc($1)} : $1 ;
push @{$h->{$field}} , $hdr ;
} elsif ( ref($h->{$field}) eq 'ARRAY') {
#print "X3\n";
$hdr =~ s/^\s+/ /;
$h->{$field}[-1] .= $hdr ;
}
}
}
use warnings;
my $candump = 0;
if ($self->Debug) {
eval {
@ -2410,6 +2448,40 @@ use constant NonFolderArg => 1; # Value to pass to Massage to
return MIME::Base64::encode($client->User() . " $hmac", "");
};
*Mail::IMAPClient::message_string = sub {
my $self = shift;
my $msg = shift;
my $expected_size = $self->size($msg);
return undef unless(defined $expected_size); # unable to get size
my $cmd = $self->has_capability('IMAP4REV1') ?
"BODY" . ( $self->Peek ? '.PEEK[]' : '[]' ) :
"RFC822" . ( $self->Peek ? '.PEEK' : '' ) ;
$self->fetch($msg,$cmd) or return undef;
my $string = "";
foreach my $result (@{$self->{"History"}{$self->Transaction}}) {
$string .= $result->[DATA]
if defined($result) and $self->_is_literal($result) ;
}
# BUG? should probably return undef if length != expected
if ( length($string) != $expected_size ) {
carp "${self}::message_string: " .
"expected $expected_size bytes but received " .
length($string);
}
if ( length($string) > $expected_size )
{ $string = substr($string,0,$expected_size) }
if ( length($string) < $expected_size ) {
$self->LastError("${self}::message_string: expected ".
"$expected_size bytes but received " .
length($string)."\n");
return $string;
#return undef;
}
return $string;
};

View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: tests.sh,v 1.72 2008/04/21 03:44:35 gilles Exp gilles $
# $Id: tests.sh,v 1.73 2008/05/08 02:10:31 gilles Exp gilles $
#### Shell pragmas
@ -1012,7 +1012,7 @@ test $# -eq 0 && run_tests \
ll_delete2 \
ll_folderrec \
ll_bigmail \
msw
# msw

36373
zzz Normal file

File diff suppressed because it is too large Load Diff