1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
imapsync/patches/imapsync-1.337_tobit_V6.patch
Nick Bebout c6cefbbb65 1.340
2011-03-12 02:44:57 +00:00

46 lines
982 B
Diff

--- imapsync-1.337 2010-08-02 13:56:06.000000000 +0200
+++ imapsync-1.337_tobit-workaround 2010-08-02 13:53:58.000000000 +0200
@@ -3821,6 +3821,7 @@
$banner;
}
+
# IMAPClient 2.2.9 3.xx ads
package Mail::IMAPClient;
@@ -3869,3 +3870,33 @@
#$self->Fast_io( $self->Fast_io );
$sock;
}
+
+sub search {
+ my ( $self, @args ) = @_;
+
+ @args = $self->_quote_search(@args);
+
+ $self->_imap_uid_command( SEARCH => @args )
+ or return undef;
+
+ my @hits;
+ foreach ( $self->History ) {
+ chomp;
+ s/$CR?$LF$//o;
+ s/^(\s*\d+)/* SEARCH $1/;
+ s/^\*\s+SEARCH\s+(?=.*?\d)// or next;
+ push @hits, grep /^\d+$/, split;
+ }
+
+ @hits
+ or $self->_debug("Search successful but found no matching messages");
+
+ # return empty list
+ return
+ wantarray ? @hits
+ : !@hits ? \@hits
+ : $self->Ranges ? $self->Range( \@hits )
+ : \@hits;
+}
+
+