From owner-cvs-all@FreeBSD.ORG Mon Oct 3 19:14:46 2011 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 574E8106566C; Mon, 3 Oct 2011 19:14:46 +0000 (UTC) (envelope-from bsam@passap.ru) Received: from forward7.mail.yandex.net (forward7.mail.yandex.net [IPv6:2a02:6b8:0:202::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6E90D8FC0C; Mon, 3 Oct 2011 19:14:45 +0000 (UTC) Received: from smtp9.mail.yandex.net (smtp9.mail.yandex.net [77.88.61.35]) by forward7.mail.yandex.net (Yandex) with ESMTP id C614C1C211D; Mon, 3 Oct 2011 23:14:43 +0400 (MSD) Received: from smtp9.mail.yandex.net (localhost [127.0.0.1]) by smtp9.mail.yandex.net (Yandex) with ESMTP id 9167215203E1; Mon, 3 Oct 2011 23:14:43 +0400 (MSD) Received: from 93.91.1.120.tel.ru (93.91.1.120.tel.ru [93.91.1.120]) by smtp9.mail.yandex.net (nwsmtp/Yandex) with ESMTP id EguaNkVQ-EhumTmXb; Mon, 3 Oct 2011 23:14:43 +0400 X-Yandex-Spam: 1 From: Boris Samorodov To: Doug Barton In-Reply-To: <4E8A0449.1020303@FreeBSD.org> References: <201110031305.p93D5K3x082695@repoman.freebsd.org> <4E8A0449.1020303@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" Date: Mon, 03 Oct 2011 23:14:42 +0400 Message-ID: <1317669282.4008.4.camel@bsam.tel.ru> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 03 Oct 2011 20:13:19 +0000 Cc: cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, Boris Samorodov , ports-committers@FreeBSD.org Subject: Re: cvs commit: ports/mail/imaptools distinfo X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2011 19:14:46 -0000 В пн, 03/10/2011 в 11:51 -0700, Doug Barton пишет: > On 10/03/2011 06:05, Boris Samorodov wrote: > > bsam 2011-10-03 13:05:20 UTC > > > > FreeBSD ports repository > > > > Modified files: > > mail/imaptools distinfo > > Log: > > Update distinfo and fix fetching. The distfile was rerolled without > > changing the version. Confirmed by the author via private e-mail. > > He said that it's not a good practice and would avoid doing it in > > the future. > > > > Reported by: pontyhat (pavmail) > > > > Revision Changes Path > > 1.10 +2 -2 ports/mail/imaptools/distinfo > > > > http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/mail/imaptools/distinfo.diff?&r1=1.9&r2=1.10&f=h > > > Confirming with the author is fine, but did you compare the old and new > distfiles yourself? If so, what changed? Yes, I compared them: ----- diff -ruN 15/old/migrateIMAP.pl 15/new/migrateIMAP.pl --- 15/old/migrateIMAP.pl 2011-09-28 08:08:54.000000000 +0400 +++ 15/new/migrateIMAP.pl 2011-09-30 09:21:15.000000000 +0400 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Header: /mhub4/sources/imap-tools/migrateIMAP.pl,v 1.13 2011/09/28 04:29:54 rick Exp $ +# $Header: /mhub4/sources/imap-tools/migrateIMAP.pl,v 1.14 2011/09/30 05:42:21 rick Exp $ #************************************************************************* # * @@ -22,8 +22,6 @@ init(); -$showIMAP=1; - # Get the list of usernames and passwords @users = getUserList( $userlist ); @@ -131,6 +129,8 @@ createMbx( $mbx, $dst ) unless mbxExists( $mbx, $dst); + get_supported_flags( $mbx, $dst, \%SUPPORTED_FLAGS ); + if ( $sent_after ) { getDatedMsgList( $mbx, $sent_after, \@msgs, $src ); } else { @@ -162,6 +162,7 @@ $added=0; foreach $_ ( @msgs ) { ($msgnum,$date,$flags,$msgid) = split(/\|/, $_); + $flags = validate_flags( $flags, \%SUPPORTED_FLAGS ); if ( $update ) { # If we are in 'update' mode then don't copy @@ -676,8 +677,7 @@ if ( $response =~ /^1 OK/i ) { # print STDERR "response $response\n"; last; - } - elsif ( $response !~ /^\*/ ) { + } elsif ( $response !~ /^\*/ ) { Log ("unexpected response: $response"); # print STDERR "Error: $response\n"; return 0; @@ -878,7 +878,6 @@ } elsif ( $response !~ /^\*/ ) { Log ("Unexpected APPEND response: >$response<"); -exit; # next; return 0; } @@ -1427,3 +1426,49 @@ } } + +sub get_supported_flags { + +my $mbx = shift; +my $conn = shift; +my $FLAGS = shift; + + # Determine which flags are supported by the mailbox + + sendCommand ($conn, "1 EXAMINE \"$mbx\""); + undef @response; + $empty=0; + while ( 1 ) { + readResponse ( $conn ); + if ( $response =~ /^1 OK/i ) { + last; + } elsif ( $response !~ /^\*/ ) { + Log ("unexpected response: $response"); + last; + } elsif ( $response =~ /^\* FLAGS \((.+)\)/i ) { + %$FLAGS = (); + foreach my $flag ( split(/\s+/, $1) ) { + $$FLAGS{$flag} = 1; + } + } + } + +} + +sub validate_flags { + +my $flags = shift; +my $valid_flags = shift; +my $newflags; + + # Remove any flags not supported by the destination mailbox + + foreach my $flag ( split(/\s+/, $flags ) ) { + next unless $$valid_flags{$flag}; + $newflags .= "$flag "; + } + chop $newflags; + + return $newflags; + +} ----- -- WBR, bsam