aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-01-04 13:15:10 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-01-04 13:15:10 +0000
commitb708a522a10d0eb943d25702e67f725200327431 (patch)
tree6cf42130446f40ca0cadd462a129e8cff9d7ab9f
parent65e8ba8e1d77f8a31cc7c9d424eee5880e3f08c8 (diff)
imap test server: Added support for the CAPABILITY command
Added support for the CAPABILITY command in preparation of upcoming changes.
-rwxr-xr-xtests/ftpserver.pl25
1 files changed, 23 insertions, 2 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 45b343635..46f4774b9 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -579,6 +579,7 @@ sub protocolsetup {
}
elsif($proto eq 'imap') {
%commandfunc = (
+ 'CAPABILITY' => \&CAPABILITY_imap,
'FETCH' => \&FETCH_imap,
'SELECT' => \&SELECT_imap,
);
@@ -759,7 +760,28 @@ my $cmdid;
# what was picked by SELECT
my $selected;
-sub SELECT_imap {
+sub CAPABILITY_imap {
+ my ($testno) = @_;
+ my $data;
+
+ if(!$support_capa) {
+ sendcontrol "$cmdid BAD Command\r\n";
+ }
+ else {
+ $data = "* CAPABILITY IMAP4";
+ if($support_auth) {
+ $data .= " AUTH=UNKNOWN";
+ }
+ $data .= " pingpong test server\r\n";
+
+ sendcontrol $data;
+ sendcontrol "$cmdid OK CAPABILITY completed\r\n";
+ }
+
+ return 0;
+}
+
+sub SELECT_IMAP {
my ($testno) = @_;
my @data;
my $size;
@@ -771,7 +793,6 @@ sub SELECT_imap {
return 0;
}
-
sub FETCH_imap {
my ($testno) = @_;
my @data;