From 4f4dc5832d5831eec64fe7dd605e1f24bc555a30 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sat, 14 Sep 2013 10:44:21 +0100 Subject: ftpserver.pl: Added support for IMAP NOOP command --- tests/ftpserver.pl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 800aa979d..6f099b105 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -595,6 +595,7 @@ sub protocolsetup { 'LIST' => \&LIST_imap, 'LSUB' => \&LSUB_imap, 'LOGOUT' => \&LOGOUT_imap, + 'NOOP' => \&NOOP_imap, 'RENAME' => \&RENAME_imap, 'SEARCH' => \&SEARCH_imap, 'SELECT' => \&SELECT_imap, @@ -1331,6 +1332,29 @@ sub UID_imap { return 0; } +sub NOOP_imap { + my ($args) = @_; + my @data = ( + "* 22 EXPUNGE\r\n", + "* 23 EXISTS\r\n", + "* 3 RECENT\r\n", + "* 14 FETCH (FLAGS (\\Seen \\Deleted))\r\n", + ); + + if ($args) { + sendcontrol "$cmdid BAD Command Argument\r\n"; + } + else { + for my $d (@data) { + sendcontrol $d; + } + + sendcontrol "$cmdid OK NOOP completed\r\n"; + } + + return 0; +} + sub LOGOUT_imap { sendcontrol "* BYE cURL IMAP server signing off\r\n"; sendcontrol "$cmdid OK LOGOUT completed\r\n"; -- cgit v1.2.3