/*
- * pop2.c -- POP@ protocol methods
+ * pop2.c -- POP2 protocol methods
*
- * Copyright 1996 by Eric S. Raymond
- * All rights reserved.
+ * Copyright 1997 by Eric S. Raymond
* For license terms, see the file COPYING in this directory.
*/
-#include <config.h>
+#include "config.h"
+
+#ifdef POP2_ENABLE
#include <stdio.h>
#if defined(STDC_HEADERS)
#include <stdlib.h>
ctl->remotename, ctl->password));
}
-static int pop2_getrange(int sock, struct query *ctl, const char *folder, int*countp, int*newp)
+static int pop2_getrange(int sock, struct query *ctl, const char *folder,
+ int *countp, int *newp, int *bytes)
/* get range of messages to be fetched */
{
/* maybe the user wanted a non-default folder */
return(PS_ERROR);
*countp = pound_arg;
- *newp = -1;
+ *bytes = *newp = -1;
return(0);
}
return(gen_transact(sock, ctl->keep ? "ACKS" : "ACKD"));
}
+static int pop2_logout(int sock, struct query *ctl)
+/* send logout command */
+{
+ return(gen_transact(sock, "QUIT"));
+}
+
const static struct method pop2 =
{
"POP2", /* Post Office Protocol v2 */
+#if INET6
+ "pop2", /* standard POP2 port */
+ "pop2", /* ssl POP2 port */
+#else /* INET6 */
109, /* standard POP2 port */
- 0, /* this is not a tagged protocol */
- 0, /* does not use message delimiter */
+ 109, /* ssl POP2 port - not */
+#endif /* INET6 */
+ FALSE, /* this is not a tagged protocol */
+ FALSE, /* does not use message delimiter */
pop2_ok, /* parse command response */
+ NULL, /* no password canonicalization */
pop2_getauth, /* get authorization */
pop2_getrange, /* query range of messages */
NULL, /* no way to get sizes */
NULL, /* messages are always new */
pop2_fetch, /* request given message */
+ NULL, /* no way to fetch body alone */
pop2_trail, /* eat message trailer */
NULL, /* no POP2 delete method */
- "QUIT", /* the POP2 exit command */
+ pop2_logout, /* log out, we're done */
+ FALSE, /* no, we can't re-poll */
};
int doPOP2 (struct query *ctl)
peek_capable = FALSE;
return(do_protocol(ctl, &pop2));
}
+#endif /* POP2_ENABLE */
/* pop2.c ends here */