]> Pileus Git - ~andy/fetchmail/blobdiff - pop2.c
Cosmetic fix.
[~andy/fetchmail] / pop2.c
diff --git a/pop2.c b/pop2.c
index 170c07ac5bddcaefb5d1fef841ff4b23880030a1..c3f490e66836d56344f7d1249dc512b5bc5ebb22 100644 (file)
--- a/pop2.c
+++ b/pop2.c
@@ -17,7 +17,7 @@
 
 static int pound_arg, equal_arg;
 
-int pop2_ok (int sock, char *argbuf)
+static int pop2_ok (int sock, char *argbuf)
 /* parse POP2 command response */
 {
     int ok;
@@ -51,15 +51,20 @@ int pop2_ok (int sock, char *argbuf)
     return(ok);
 }
 
-int pop2_getauth(int sock, struct query *ctl, char *buf)
+static int pop2_getauth(int sock, struct query *ctl, char *buf)
 /* apply for connection authorization */
 {
-    return(gen_transact(sock,
+    int status;
+
+    strcpy(shroud, ctl->password);
+    status = gen_transact(sock,
                  "HELO %s %s",
-                 ctl->remotename, ctl->password));
+                 ctl->remotename, ctl->password);
+    shroud[0] = '\0';
 }
 
-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 */
@@ -87,7 +92,7 @@ static int pop2_getrange(int sock, struct query *ctl, const char *folder, int*co
            return(PS_ERROR);
 
     *countp = pound_arg;
-    *newp = -1;
+    *bytes = *newp = -1;
 
     return(0);
 }
@@ -114,13 +119,24 @@ static int pop2_trail(int sock, struct query *ctl, int number)
     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_ENABLE
+    "pop2",                            /* standard POP2 port */
+    "pop2",                            /* ssl POP2 port */
+#else /* INET6_ENABLE */
     109,                               /* standard POP2 port */
+    109,                               /* ssl POP2 port - not */
+#endif /* INET6_ENABLE */
     FALSE,                             /* this is not a tagged protocol */
     FALSE,                             /* does not use message delimiter */
-    FALSE,                             /* no getsizes method */
     pop2_ok,                           /* parse command response */
     pop2_getauth,                      /* get authorization */
     pop2_getrange,                     /* query range of messages */
@@ -130,8 +146,8 @@ const static struct method pop2 =
     NULL,                              /* no way to fetch body alone */
     pop2_trail,                                /* eat message trailer */
     NULL,                              /* no POP2 delete method */
-    NULL,                              /* no retained-header check */
-    "QUIT",                            /* the POP2 exit command */
+    pop2_logout,                       /* log out, we're done */
+    FALSE,                             /* no, we can't re-poll */
 };
 
 int doPOP2 (struct query *ctl)