aboutsummaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-08-30 07:35:00 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-08-30 07:35:00 +0100
commit9d35ad9552f7248dea199402b049c8599e14ab7b (patch)
treeeaf9e8172f4a2ff37a6dc1bd62727f1e647ff93e /tests/ftpserver.pl
parentc4a7ca038e26a57df952b4ea560f9b718a5ebd1d (diff)
ftpserver.pl: Added support for IMAP CREATE, DELETE and RENAME commands
Diffstat (limited to 'tests/ftpserver.pl')
-rwxr-xr-xtests/ftpserver.pl52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 2756e07ca..9237a69fb 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -578,10 +578,13 @@ sub protocolsetup {
%commandfunc = (
'APPEND' => \&APPEND_imap,
'CAPABILITY' => \&CAPABILITY_imap,
+ 'CREATE' => \&CREATE_imap,
+ 'DELETE' => \&DELETE_imap,
'EXAMINE' => \&EXAMINE_imap,
'FETCH' => \&FETCH_imap,
'LIST' => \&LIST_imap,
'LOGOUT' => \&LOGOUT_imap,
+ 'RENAME' => \&RENAME_imap,
'SEARCH' => \&SEARCH_imap,
'SELECT' => \&SELECT_imap,
'STATUS' => \&STATUS_imap,
@@ -1080,6 +1083,55 @@ sub SEARCH_imap {
return 0;
}
+sub CREATE_imap {
+ my ($args) = @_;
+ fix_imap_params($args);
+
+ logmsg "CREATE_imap got $args\n";
+
+ if ($args eq "") {
+ sendcontrol "$cmdid BAD Command Argument\r\n";
+ }
+ else {
+ sendcontrol "$cmdid OK CREATE completed\r\n";
+ }
+
+ return 0;
+}
+
+sub DELETE_imap {
+ my ($args) = @_;
+ fix_imap_params($args);
+
+ logmsg "DELETE_imap got $args\n";
+
+ if ($args eq "") {
+ sendcontrol "$cmdid BAD Command Argument\r\n";
+ }
+ else {
+ sendcontrol "$cmdid OK DELETE completed\r\n";
+ }
+
+ return 0;
+}
+
+sub RENAME_imap {
+ my ($args) = @_;
+ my ($from_mailbox, $to_mailbox) = split(/ /, $args, 2);
+ fix_imap_params($from_mailbox, $to_mailbox);
+
+ logmsg "RENAME_imap got $args\n";
+
+ if (($from_mailbox eq "") || (to_mailbox eq "")) {
+ sendcontrol "$cmdid BAD Command Argument\r\n";
+ }
+ else {
+ sendcontrol "$cmdid OK RENAME completed\r\n";
+ }
+
+ return 0;
+}
+
sub LOGOUT_imap {
sendcontrol "* BYE cURL IMAP server signing off\r\n";
sendcontrol "$cmdid OK LOGOUT completed\r\n";