aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-08-29 07:20:03 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-08-29 07:20:03 +0100
commit6a353049ac94751d53e877c6b5f3c452d717cfe3 (patch)
tree8d0ae1eb56652c9990a7ff06d1d173ffe1d441cb
parent49e3d803ab5bdcb2ef1d865770a5857a7f09fe94 (diff)
ftpserver.pl: Added SELECT check to IMAP FETCH and STORE handlers
-rwxr-xr-xtests/ftpserver.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index ec7ccbba8..2655575b8 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -829,6 +829,9 @@ sub FETCH_imap {
$data[0] = $response;
logmsg "return proof we are we\n";
}
+ elsif ($selected eq "") {
+ sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
+ }
else {
logmsg "retrieve a mail\n";
@@ -941,8 +944,13 @@ sub STORE_imap {
logmsg "STORE_imap got $args\n";
- sendcontrol "* $uid FETCH (FLAGS (\\Seen \\Deleted))\r\n";
- sendcontrol "$cmdid OK STORE completed\r\n";
+ if ($selected eq "") {
+ sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
+ }
+ else {
+ sendcontrol "* $uid FETCH (FLAGS (\\Seen \\Deleted))\r\n";
+ sendcontrol "$cmdid OK STORE completed\r\n";
+ }
return 0;
}