aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-08-27 20:47:31 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-08-27 20:47:31 +0100
commit3d1a453d887a6272f48c241af6190d17891aef02 (patch)
tree63b9eb814d026943d774a91f7bf552e888e03ea3
parentd7a39f8f97b38605f42e0f87dd2f5c4565d08a60 (diff)
ftpserver.pl: Added support for IMAP SEARCH command
-rwxr-xr-xtests/ftpserver.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index c32165b62..0e4a7bce6 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -582,6 +582,7 @@ sub protocolsetup {
'FETCH' => \&FETCH_imap,
'LIST' => \&LIST_imap,
'LOGOUT' => \&LOGOUT_imap,
+ 'SEARCH' => \&SEARCH_imap,
'SELECT' => \&SELECT_imap,
'STATUS' => \&STATUS_imap,
'STORE' => \&STORE_imap
@@ -1031,6 +1032,32 @@ sub STATUS_imap {
return 0;
}
+sub SEARCH_imap {
+ my ($testno) = @_;
+ fix_imap_params($testno);
+
+ logmsg "SEARCH_imap got test $testno\n";
+
+ $testno =~ s/[^0-9]//g;
+ my $testpart = "";
+ if ($testno > 10000) {
+ $testpart = $testno % 10000;
+ $testno = int($testno / 10000);
+ }
+
+ loadtest("$srcdir/data/test$testno");
+
+ my @data = getpart("reply", "data$testpart");
+
+ for my $d (@data) {
+ sendcontrol $d;
+ }
+
+ sendcontrol "$cmdid OK SEARCH completed\r\n";
+
+ return 0;
+}
+
sub LOGOUT_imap {
sendcontrol "* BYE cURL IMAP server signing off\r\n";
sendcontrol "$cmdid OK LOGOUT completed\r\n";