mirror of https://github.com/moparisthebest/curl
ftpserver.pl: Added support for POP3 UIDL command
This commit is contained in:
parent
2481ac358c
commit
66ea5c415b
|
@ -564,6 +564,7 @@ sub protocolsetup {
|
||||||
'QUIT' => \&QUIT_pop3,
|
'QUIT' => \&QUIT_pop3,
|
||||||
'RETR' => \&RETR_pop3,
|
'RETR' => \&RETR_pop3,
|
||||||
'STAT' => \&STAT_pop3,
|
'STAT' => \&STAT_pop3,
|
||||||
|
'UIDL' => \&UIDL_pop3,
|
||||||
);
|
);
|
||||||
%displaytext = (
|
%displaytext = (
|
||||||
'USER' => '+OK We are happy you popped in!',
|
'USER' => '+OK We are happy you popped in!',
|
||||||
|
@ -1377,6 +1378,28 @@ sub NOOP_pop3 {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub UIDL_pop3 {
|
||||||
|
# This is a built-in fake-message UID list
|
||||||
|
my @data = (
|
||||||
|
"1 1\r\n",
|
||||||
|
"2 2\r\n",
|
||||||
|
"3 4\r\n", # Note that UID 3 is a simulated "deleted" message
|
||||||
|
);
|
||||||
|
|
||||||
|
logmsg "retrieve a message UID list\n";
|
||||||
|
|
||||||
|
sendcontrol "+OK Listing starts\r\n";
|
||||||
|
|
||||||
|
for my $d (@data) {
|
||||||
|
sendcontrol $d;
|
||||||
|
}
|
||||||
|
|
||||||
|
# End with the magic 3-byte end of listing marker
|
||||||
|
sendcontrol ".\r\n";
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
sub QUIT_pop3 {
|
sub QUIT_pop3 {
|
||||||
sendcontrol "+OK byebye\r\n";
|
sendcontrol "+OK byebye\r\n";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue