]> Pileus Git - ~andy/fetchmail/blobdiff - pop2.c
Add settable server-nonresponse timeout
[~andy/fetchmail] / pop2.c
diff --git a/pop2.c b/pop2.c
index e37baaa9cc7839d7b1997861df72e49aa8ffe7eb..bccc1b6e95b6b9b242b1a87a766f303bc67cd87d 100644 (file)
--- a/pop2.c
+++ b/pop2.c
 
 static int pound_arg, equal_arg;
 
-int pop2_ok (argbuf,socket)
+int pop2_ok (socket, argbuf)
 /* parse POP2 command response */
-char *argbuf;
 int socket;
+char *argbuf;
 {
     int ok;
     char buf [POPBUFSIZE+1];
@@ -68,12 +68,11 @@ char *buf;
                  queryctl->remotename, queryctl->password));
 }
 
-static pop2_getrange(socket, queryctl, countp, firstp)
+static pop2_getrange(socket, queryctl, countp)
 /* get range of messages to be fetched */
 int socket;
 struct hostrec *queryctl;
 int *countp;
-int *firstp;
 {
     /*
      * We should have picked up a count of messages in the user's
@@ -83,9 +82,9 @@ int *firstp;
        return(PS_ERROR);
 
     /* maybe the user wanted a non-default folder */
-    if (queryctl->remotefolder[0])
+    if (queryctl->mailbox[0])
     {
-       int     ok = gen_transact(socket, "FOLD %s", queryctl->remotefolder);
+       int     ok = gen_transact(socket, "FOLD %s", queryctl->mailbox);
 
        if (ok != 0)
            return(ok);
@@ -93,17 +92,15 @@ int *firstp;
            return(PS_ERROR);
     }
 
-    *firstp = 1;
     *countp = pound_arg;
 
     return(0);
 }
 
-static int pop2_fetch(socket, number, limit, lenp)
+static int pop2_fetch(socket, number, lenp)
 /* request nth message */
 int socket;
 int number;
-int limit;
 int *lenp; 
 {
     int        ok;
@@ -128,7 +125,7 @@ int number;
     return(gen_transact(socket, queryctl->keep ? "ACKS" : "ACKD"));
 }
 
-static struct method pop2 =
+const static struct method pop2 =
 {
     "POP2",                            /* Post Office Protocol v2 */
     109,                               /* standard POP2 port */
@@ -137,9 +134,10 @@ static struct method pop2 =
     pop2_ok,                           /* parse command response */
     pop2_getauth,                      /* get authorization */
     pop2_getrange,                     /* query range of messages */
+    NULL,                              /* messages are always new */
     pop2_fetch,                                /* request given message */
     pop2_trail,                                /* eat message trailer */
-    NULL,                              /* no POP2 delete command */
+    NULL,                              /* no POP2 delete method */
     NULL,                              /* no POP2 expunge command */
     "QUIT",                            /* the POP2 exit command */
 };
@@ -147,19 +145,5 @@ static struct method pop2 =
 int doPOP2 (queryctl)
 struct hostrec *queryctl;
 {
-    /* check for unsupported options */
-    if (linelimit) {
-       fprintf(stderr,"Option --limit is not supported with POP2\n");
-       return(PS_SYNTAX);
-    }
-    else if (queryctl->flush) {
-       fprintf(stderr,"Option --flush is not supported with POP2\n");
-       return(PS_SYNTAX);
-    }
-    else if (queryctl->fetchall) {
-       fprintf(stderr,"Option --all is not supported with POP2\n");
-       return(PS_SYNTAX);
-    }
-
     return(do_protocol(queryctl, &pop2));
 }