1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 08:12:48 +01:00
imapsync/W/patches/imapsync-1.337_tobit_V6.patch
Nick Bebout c08a56e486 1.504
2012-09-02 19:08:57 -05: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;
+}
+
+