implement CAPA

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11049 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2002-07-04 14:09:47 +00:00
parent 0a54c90661
commit 7ffddc6d13

View File

@@ -11,6 +11,7 @@ RCSID("$Id$");
* get_command: Extract the command from an input line form a POP client
*/
int pop_capa (POP *p);
static state_table states[] = {
{auth1, "user", 1, 1, pop_user, {auth1, auth2}},
{auth2, "pass", 1, 99, pop_pass, {auth1, trans}},
@@ -19,6 +20,11 @@ static state_table states[] = {
#endif /* RPOP */
{auth1, "quit", 0, 0, pop_quit, {halt, halt}},
{auth2, "quit", 0, 0, pop_quit, {halt, halt}},
#ifdef CAPA
{auth1, "capa", 0, 0, pop_capa, {auth1, auth1}},
{auth2, "capa", 0, 0, pop_capa, {auth2, auth2}},
{trans, "capa", 0, 0, pop_capa, {trans, trans}},
#endif
{trans, "stat", 0, 0, pop_stat, {trans, trans}},
{trans, "list", 0, 1, pop_list, {trans, trans}},
{trans, "retr", 1, 1, pop_send, {trans, trans}},
@@ -41,6 +47,35 @@ static state_table states[] = {
{(state) 0, NULL, 0, 0, NULL, {halt, halt}},
};
int
pop_capa (POP *p)
{
/* Search for the POP command in the command/state table */
pop_msg (p,POP_SUCCESS, "Capability list follows");
fprintf(p->output, "USER\r\n");
fprintf(p->output, "TOP\r\n");
fprintf(p->output, "PIPELINING\r\n");
fprintf(p->output, "EXPIRE NEVER\r\n");
fprintf(p->output, "RESP-CODES\r\n");
#ifdef UIDL
fprintf(p->output, "UIDL\r\n");
#endif
#ifdef XOVER
fprintf(p->output, "XOVER\r\n");
#endif
#ifdef XDELE
fprintf(p->output, "XDELE\r\n");
#endif
if(p->CurrentState == trans)
fprintf(p->output, "IMPLEMENTATION %s-%s\r\n", PACKAGE, VERSION);
fprintf(p->output,".\r\n");
fflush(p->output);
p->flags |= POP_FLAG_CAPA;
return(POP_SUCCESS);
}
state_table *
pop_get_command(POP *p, char *mp)
{