From 7ffddc6d13314e840af8b6bc15adef99ff3d2978 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Thu, 4 Jul 2002 14:09:47 +0000 Subject: [PATCH] implement CAPA git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11049 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/popper/pop_get_command.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/appl/popper/pop_get_command.c b/appl/popper/pop_get_command.c index c1f628dca..d10e4dc54 100644 --- a/appl/popper/pop_get_command.c +++ b/appl/popper/pop_get_command.c @@ -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) {