"3 4\r\n", # Note that UID 3 is a simulated "deleted" message
);
- logmsg "retrieve a message UID list\n";
+ if (!grep /^UIDL$/, @capabilities) {
+ sendcontrol "-ERR Unrecognized command\r\n";
+ }
+ else {
+ logmsg "retrieve a message UID list\n";
- sendcontrol "+OK Listing starts\r\n";
+ sendcontrol "+OK Listing starts\r\n";
- for my $d (@data) {
- sendcontrol $d;
- }
+ for my $d (@data) {
+ sendcontrol $d;
+ }
- # End with the magic 3-byte end of listing marker
- sendcontrol ".\r\n";
+ # End with the magic 3-byte end of listing marker
+ sendcontrol ".\r\n";
+ }
return 0;
}
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";
}
else {