Skip to content
Snippets Groups Projects
Commit 9d35ad95 authored by Steve Holme's avatar Steve Holme
Browse files

ftpserver.pl: Added support for IMAP CREATE, DELETE and RENAME commands

parent c4a7ca03
No related branches found
No related tags found
No related merge requests found
......@@ -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";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment