mirror of
https://github.com/curl/curl.git
synced 2025-09-26 05:56:48 +03:00
ftpserver.pl: Added capability prerequisite for extended POP3 commands
This commit is contained in:
parent
b68c52704b
commit
4d6ef6297a
|
@ -1556,6 +1556,10 @@ sub UIDL_pop3 {
|
||||||
"3 4\r\n", # Note that UID 3 is a simulated "deleted" message
|
"3 4\r\n", # Note that UID 3 is a simulated "deleted" message
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!grep /^UIDL$/, @capabilities) {
|
||||||
|
sendcontrol "-ERR Unrecognized command\r\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
logmsg "retrieve a message UID list\n";
|
logmsg "retrieve a message UID list\n";
|
||||||
|
|
||||||
sendcontrol "+OK Listing starts\r\n";
|
sendcontrol "+OK Listing starts\r\n";
|
||||||
|
@ -1566,6 +1570,7 @@ sub UIDL_pop3 {
|
||||||
|
|
||||||
# End with the magic 3-byte end of listing marker
|
# End with the magic 3-byte end of listing marker
|
||||||
sendcontrol ".\r\n";
|
sendcontrol ".\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1576,7 +1581,10 @@ sub TOP_pop3 {
|
||||||
|
|
||||||
logmsg "TOP_pop3 got $args\n";
|
logmsg "TOP_pop3 got $args\n";
|
||||||
|
|
||||||
if (($msg eq "") || ($lines eq "")) {
|
if (!grep /^TOP$/, @capabilities) {
|
||||||
|
sendcontrol "-ERR Unrecognized command\r\n";
|
||||||
|
}
|
||||||
|
elsif ((!$msg) || (!$lines)) {
|
||||||
sendcontrol "-ERR Protocol error\r\n";
|
sendcontrol "-ERR Protocol error\r\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user