diff options
author | Jiri Hruska <jirka@fud.cz> | 2013-03-06 22:16:19 +0100 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-03-06 21:36:12 +0000 |
commit | 81408d21110d17e072beb7da7b31783ce03ba9f3 (patch) | |
tree | 9016737bc14fa1d9b7efd9a3d019913b6cd2ddd1 | |
parent | 5c89413b245f523478bf5e50d25eb84ecb3fddce (diff) |
imap: Fixed ftpserver.pl to allow verification even through LIST command
Commit 198012ee inadvertently broke LIST_imap().
-rwxr-xr-x | tests/ftpserver.pl | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 1be686196..b4076f4be 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -940,20 +940,32 @@ sub STORE_imap { sub LIST_imap { my ($args) = @_; my ($reference, $mailbox) = split(/ /, $args, 2); + my @data; logmsg "LIST_imap got $args\n"; - my $testno = $reference; - $testno =~ s/^([^0-9]*)//; - my $testpart = ""; - if ($testno > 10000) { - $testpart = $testno % 10000; - $testno = int($testno / 10000); + if ($reference eq '"verifiedserver"') { + # this is the secret command that verifies that this actually is + # the curl test server + @data = ("* LIST () \"/\" \"WE ROOLZ: $$\"\r\n"); + if($verbose) { + print STDERR "FTPD: We returned proof we are the test server\n"; + } + logmsg "return proof we are we\n"; } + else { + my $testno = $reference; + $testno =~ s/^([^0-9]*)//; + my $testpart = ""; + if ($testno > 10000) { + $testpart = $testno % 10000; + $testno = int($testno / 10000); + } - loadtest("$srcdir/data/test$testno"); + loadtest("$srcdir/data/test$testno"); - my @data = getpart("reply", "data$testpart"); + @data = getpart("reply", "data$testpart"); + } for my $d (@data) { sendcontrol $d; |