summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/appl/popper/pop_get_command.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/appl/popper/pop_get_command.c')
-rw-r--r--crypto/heimdal/appl/popper/pop_get_command.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/crypto/heimdal/appl/popper/pop_get_command.c b/crypto/heimdal/appl/popper/pop_get_command.c
index e43c1d9..f10c3fe 100644
--- a/crypto/heimdal/appl/popper/pop_get_command.c
+++ b/crypto/heimdal/appl/popper/pop_get_command.c
@@ -5,12 +5,13 @@
*/
#include <popper.h>
-RCSID("$Id: pop_get_command.c,v 1.15 1999/09/16 20:38:49 assar Exp $");
+RCSID("$Id: pop_get_command.c,v 1.16 2002/07/04 14:09:47 joda Exp $");
/*
* 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)
{
OpenPOWER on IntegriCloud