[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [imapsync] BAD parse error: invalid digit in date string


From "Phil Pearl (Lobbes)" <phil at zimbra dot com>
Subject Re: [imapsync] BAD parse error: invalid digit in date string
Date Mon, 30 Nov 2009 08:19:14 -0800 (PST)

This seems to be a feature of Date::Manip v6.  See:
  http://search.cpan.org/dist/Date-Manip/lib/Date/Manip/Changes5to6.pod

About 3/4 of the way through that doc you'll see:
  %z format
    In Date::Manip 5.xx, the %z format would give an offset in the form: -0500. Now it gives it in the form: -05:00:00

At a quick glance, it appears the author didn't provide any mechanism to output the IMAP required format but I may have missed something.

A quick hack would be to modify the good_date() subroutine in imapsync to be something like this (one line hack added):

            sub good_date {
                my ($d) = @_;
                $d = UnixDate(ParseDate($d), "%d-%b-%Y %H:%M:%S %z");
                $d =~ s/:(\d{2}):\d{2}$/$1/;  # hack to work around Date::Manip v6
                $d = "\"$d\"";
                return($d);
            }

Phil

----- Original Message -----
From: "Mike" <mike at soroki dot com>
To: "Phil Pearl (Lobbes)" <phil at zimbra dot com>
Cc: imapsync at linux-france dot org
Sent: Monday, November 30, 2009 9:02:22 AM GMT -05:00 US/Canada Eastern
Subject: Re: [imapsync] BAD parse error: invalid digit in date string

Hi Phil,

Thanks for a prompt reply.  Here is the output I get when I issue perl command:

[root at sandbox ~]# perl -le 'use Date::Manip; my $d = shift; print Date::Manip->VERSION, " gives: ", UnixDate(ParseDate($d), "%d-%b-%Y %H:%M:%S %z");' "30-Dec-2003 19:25:26 -0500"

 

6.04 gives: 30-Dec-2003 19:25:26 -05:00:00

 

[root at sandbox ~]# uname -a

Linux sandbox 2.6.30.9-96.fc11.i686.PAE #1 SMP Tue Nov 3 23:41:33 EST 2009 i686 i686 i386 GNU/Linux


Regards,
Mike

Quoting "Phil Pearl (Lobbes)" <phil at zimbra dot com>:

> Using this info...
>
>> internal date from 1: [30-Dec-2003 19:25:26 -0500]
>> internal date from 1: ["30-Dec-2003 19:25:26 -05:00:00"] (fixed)
>> flags from: [\Seen $NotJunk]["30-Dec-2003 19:25:26 -05:00:00"]
>> Couldn't append msg #101 (Subject:[RE: Greetings!]) to folder
>> Inbox/Joseph: Error sending '110 APPEND Inbox/Jobs (\Seen $NotJunk)
>> "30-Dec-2003 19:25:26 -05:00:00" {6116}': 110 BAD parse error:
>> invalid digit in date string
>
> For some reason the append is being attempted with an invalid
> date-time specifier.  For reference, here's what the rfc
> (http://www.faqs.org/rfcs/rfc3501.html) has:
>
>   append          = "APPEND" SP mailbox [SP flag-list] [SP date-time] SP
>                     literal
>   ...
>   date-time       = DQUOTE date-day-fixed "-" date-month "-" date-year
>                     SP time SP zone DQUOTE
>   ...
>   zone            = ("+" / "-") 4DIGIT
>                       ; Signed four-digit value of hhmm representing
>                       ; hours and minutes east of Greenwich (that is,
>                       ; the amount that the given time differs from
>                       ; Universal Time).  Subtracting the timezone
>                       ; from the given time will give the UT form.
>                       ; The Universal Time zone is "+0000".
>
> The curious thing is that looking at the debug a good date-time
> specifier (30-Dec-2003 19:25:26 -0500) is being turned into a bad
> date-time specifier (30-Dec-2003 19:25:26 -05:00:00).  In the code a
> subroutine good_date() is called using UnixDate(ParseDate(...)) to
> fix up the date but it appears for some reason on your system the
> wrong thing happens.
>
> What version of Date::Manip is imapsync using when this happens? 
> Please try the following and let us know the output (this may require
> you adjust PERL5LIB or use -I @INCPATH to match whatever you use when
> running imapsync):
>
>   $ perl -le 'use Date::Manip; my $d = shift; print
> Date::Manip->VERSION, " gives: ", UnixDate(ParseDate($d), "%d-%b-%Y
> %H:%M:%S %z");' "30-Dec-2003 19:25:26 -0500"
>
> On my RHEL4 test box I get good output:
>   5.54 gives: 30-Dec-2003 19:25:26 -0500
>
> Phil
>
> ----- Original Message -----
> From: "Mike" <mike at soroki dot com>
> To: imapsync at linux-france dot org
> Sent: Sunday, November 29, 2009 10:25:58 PM GMT -05:00 US/Canada Eastern
> Subject: [imapsync] BAD parse error: invalid digit in date string
>
> Hi,
>
> Tried posting a similar question on Zimbra forum but so far without
> any feedback. I was hoping that maybe this forum might be a more
> appropriate place to ask...
>
> I was planning to migrate from Qmail/Courier-imap v4.1.1 to the
> latest OpenSource Zimbra GA. I have a few accounts that I would like
> to move over to the new setup. Reading through the posts, I am
> sensing that a lot of people recommending to utilize ImapSync tool to
> migrate existing e-mail accounts over.
>
> My initial efforts resulted in an empty IMAP folders with errors
> related to date format in the header for each email message. Tried
> searching through the forum and no one seems to yet doubt with this
> particular error in this particular release... Any help would be
> greatly appreciated...
>
> zcs-6.0.3_GA_1915.F11.20091118105056
> imapsync-1.286
> Courier-imap v4.1.1
>
> imapsync --buffersize 8192000 --nosyncacls --subscribe
> --syncinternaldates --host1 10.0.0.1 --user1 client1 --password1
> clientpass --host2 10.0.0.2 --user2 client2 --password2 clientpass2
> --noauthmd5 --folder Inbox.Jobs --debug
>
> ++++ Looping on each folder ++++
> From Folder [Inbox.Jobs]
> To Folder [Inbox/Jobs]
> To Folder Inbox/Jobs does not exist
> Creating folder [Inbox/Jobs]
> ++++ From [Inbox.Jobs] Parse 1 ++++
> ++++ To [Inbox/Jobs] Parse 1 ++++
> ++++ Verifying [Inbox.Jobs] -> [Inbox/Jobs] ++++
>
> + NO msg #4 [R7k4uMKC0mCiZgQLnmzYeg:12320] in Inbox/Jobs
> + Copying msg #4:12320 to folder Inbox/Jobs
> flags from: [\Seen $NotJunk]["21-May-2002 11:37:52 -04:00:00"]
> Couldn't append msg #4 (Subject:[Delivered: Admin]) to folder
> Inbox/Jobs: Error sending '13 APPEND Inbox/Jobs (\Seen $NotJunk)
> "21-May-2002 11:37:52 -04:00:00" {12320}': 13 BAD parse error:
> invalid digit in date string
>
>
> ------=_NextPart_000_0ED0_01C58F26.6170F890--
> F message content ended on previous line
> ==================================================
> ==============================
> internal date from 1: [30-Dec-2003 19:25:26 -0500]
> internal date from 1: ["30-Dec-2003 19:25:26 -05:00:00"] (fixed)
> flags from: [\Seen $NotJunk]["30-Dec-2003 19:25:26 -05:00:00"]
> Couldn't append msg #101 (Subject:[RE: Greetings!]) to folder
> Inbox/Joseph: Error sending '110 APPEND Inbox/Jobs (\Seen $NotJunk)
> "30-Dec-2003 19:25:26 -05:00:00" {6116}': 110 BAD parse error:
> invalid digit in date string
> Time: 7 s
> ++++ End looping on each folder ++++
> ++++ Statistics ++++
> Time : 8 sec
> Messages transferred : 0
> Messages skipped : 0
> Total bytes transferred: 0
> Total bytes skipped : 0
> Total bytes error : 2178889
> Detected 101 errors
>
>