diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2011-03-17 16:59:30 -0700 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2011-03-17 16:59:30 -0700 |
commit | ef1c18b952de0763037b7c940cc6960bbf990912 (patch) | |
tree | ffa970c9b44bdf94c3480529c52b50ad2d60137c /tests/ftpserver.pl | |
parent | 409867e62bf1b12e0fa0d39007256b5807a60cea (diff) |
Added support for LISTing a single POP3 message
Added tests for a number of POP3 LIST operations, including one
that shows a curl problem when listing no messages, so is
disabled.
Diffstat (limited to 'tests/ftpserver.pl')
-rwxr-xr-x | tests/ftpserver.pl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index bbbf7be29..182511f13 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -392,6 +392,7 @@ sub protocolsetup { elsif($proto eq 'pop3') { %commandfunc = ( 'RETR' => \&RETR_pop3, + 'LIST' => \&LIST_pop3, ); %displaytext = ( 'USER' => '+OK We are happy you popped in!', @@ -683,6 +684,29 @@ sub RETR_pop3 { return 0; } +sub LIST_pop3 { + +# this is a built-in fake-message list +my @pop3list=( +"1 100\r\n", +"2 4294967400\r\n", # > 4 GB +"4 200\r\n", # Note that message 3 is a simulated "deleted" message +); + + logmsg "retrieve a message list\n"; + + sendcontrol "+OK Listing starts\r\n"; + + for my $d (@pop3list) { + sendcontrol $d; + } + + # end with the magic 5-byte end of listing marker + sendcontrol "\r\n.\r\n"; + + return 0; +} + ################ ################ FTP commands ################ |