ftpserver.pl: Reworked unrecognised command responses
authorSteve Holme <steve_holme@hotmail.com>
Sun, 10 Nov 2013 10:20:50 +0000 (10:20 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 10 Nov 2013 10:20:50 +0000 (10:20 +0000)
As the IMAP regex could fail and $1 would not contain the command id
updated the unrecognised command response to be more generic and
realistic (like those used in the command handlers).

Additionally updated the POP3, SMTP and FTP responses.

tests/ftpserver.pl

index 410bbd4ec1a1643717af87718a4ddc342f892741..4f0e9f20cb14f40ba2434d01b1f84033b21bc406 100755 (executable)
@@ -3062,7 +3062,7 @@ while(1) {
                 $FTPARG="";
             }
             else {
-                sendcontrol "$1 '$full': command not understood.\r\n";
+                sendcontrol "$full BAD Command\r\n";
                 last;
             }
         }
@@ -3073,7 +3073,7 @@ while(1) {
         elsif($proto eq "pop3") {
             # POP3 long "commands" are base64 authentication data
             unless($full =~ /^[A-Z0-9+\/]*={0,2}$/i) {
-                sendcontrol "-ERR '$full': command not understood.\r\n";
+                sendcontrol "-ERR Unrecognized command\r\n";
                 last;
             }
 
@@ -3086,7 +3086,7 @@ while(1) {
             $FTPARG="";
         }
         else {
-            sendcontrol "500 '$full': command not understood.\r\n";
+            sendcontrol "500 Unrecognized command\r\n";
             last;
         }