ftpserver.pl: Fixed imap logout confirmation data
authorSteve Holme <steve_holme@hotmail.com>
Fri, 26 Apr 2013 20:12:36 +0000 (21:12 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Fri, 26 Apr 2013 20:12:36 +0000 (21:12 +0100)
An IMAP server should response with the BYE continuation response before
confirming the LOGOUT command was successful.

tests/ftpserver.pl

index f6cb255..4c0144f 100755 (executable)
@@ -581,12 +581,12 @@ sub protocolsetup {
             'EXAMINE' => \&EXAMINE_imap,
             'FETCH'  => \&FETCH_imap,
             'LIST'   => \&LIST_imap,
+            'LOGOUT'   => \&LOGOUT_imap,
             'SELECT' => \&SELECT_imap,
             'STORE'  => \&STORE_imap
         );
         %displaytext = (
             'LOGIN'  => ' OK We are happy you popped in!',
-            'LOGOUT' => ' OK thanks for the fish',
             'welcome' => join("",
             '        _   _ ____  _     '."\r\n",
             '    ___| | | |  _ \| |    '."\r\n",
@@ -1004,6 +1004,13 @@ sub EXAMINE_imap {
     return 0;
 }
 
+sub LOGOUT_imap {
+    sendcontrol "* BYE cURL IMAP server signing off\r\n";
+    sendcontrol "$cmdid OK LOGOUT completed\r\n";
+
+    return 0;
+}
+
 ################
 ################ POP3 commands
 ################