POP3: fix multi-line responses

Some POP3 commands are multi-line, e.g. have responses terminated by a
last line with '.', but some are not. Define the known command
properties and fix response handling.

Add test case for STAT.

Fixes #14677
Reported-by: ralfjunker on github
Closes #14707
This commit is contained in:
Stefan Eissing 2024-08-28 11:09:43 +02:00 committed by Daniel Stenberg
parent bc81292ea6
commit 4cd10ee28b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 107 additions and 7 deletions

47
tests/data/test997 Normal file
View file

@ -0,0 +1,47 @@
<testcase>
<info>
<keywords>
POP3
Clear Text
STAT
CUSTOMREQUEST
RFC2449
</keywords>
</info>
#
# Server-side
<reply>
<servercmd>
CAPA TOP USER
</servercmd>
<data>
</data>
</reply>
#
# Client-side
<client>
<server>
pop3
</server>
<name>
POP3 retrieve STAT (CUSTOMREQUEST)
</name>
<command>
pop3://%HOSTIP:%POP3PORT -u user:secret -X 'STAT'
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<protocol>
CAPA
USER user
PASS secret
STAT
QUIT
</protocol>
</verify>
</testcase>