]> granicus.if.org Git - curl/commitdiff
ftpserver.pl: Added support for the IMAP CHECK command
authorSteve Holme <steve_holme@hotmail.com>
Sat, 31 Aug 2013 17:29:15 +0000 (18:29 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 31 Aug 2013 17:40:46 +0000 (18:40 +0100)
tests/ftpserver.pl

index 489c3f14121572bc380ffb3b47fb17857e328da1..f3c84942ab193970be29549eecc4cc8a4f507161 100755 (executable)
@@ -578,6 +578,7 @@ sub protocolsetup {
         %commandfunc = (
             'APPEND'     => \&APPEND_imap,
             'CAPABILITY' => \&CAPABILITY_imap,
+            'CHECK'      => \&CHECK_imap,
             'CREATE'     => \&CREATE_imap,
             'DELETE'     => \&DELETE_imap,
             'EXAMINE'    => \&EXAMINE_imap,
@@ -1162,6 +1163,17 @@ sub RENAME_imap {
     return 0;
 }
 
+sub CHECK_imap {
+    if ($selected eq "") {
+        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
+    }
+    else {
+        sendcontrol "$cmdid OK CHECK completed\r\n";
+    }
+
+    return 0;
+}
+
 sub LOGOUT_imap {
     sendcontrol "* BYE cURL IMAP server signing off\r\n";
     sendcontrol "$cmdid OK LOGOUT completed\r\n";