]> Pileus Git - ~andy/fetchmail/blobdiff - pop2.c
Refer to FETCHMAIL_SSL_SECLEVEL.
[~andy/fetchmail] / pop2.c
diff --git a/pop2.c b/pop2.c
index 8bfefb4c44c4093bb73dd238e52e78d3d21e27fe..5a5a1bd1cfcec35f4c68028ca19b89cc9bfa08e9 100644 (file)
--- a/pop2.c
+++ b/pop2.c
@@ -8,14 +8,10 @@
 #include  "config.h"
 
 #ifdef POP2_ENABLE
+#include  "fetchmail.h"
 #include  <stdio.h>
-#if defined(STDC_HEADERS)
 #include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
 #include <string.h>
-#endif
-#include  "fetchmail.h"
 #include  "socket.h"
 #include  "i18n.h"
 
@@ -61,21 +57,30 @@ static int pop2_getauth(int sock, struct query *ctl, char *buf)
     int status;
 
     (void)buf;
+
     if (ctl->sslproto && !strcasecmp(ctl->sslproto, "tls1") && !ctl->use_ssl)
     {
-       report(stderr, GT_("POP2 does not support STARTTLS. Giving up.\n"));
+       report(stderr, GT_("POP2 does not support STLS. Giving up.\n"));
        return PS_SOCKET;
     }
+
+    if (ctl->server.authenticate != A_ANY && ctl->server.authenticate != A_PASSWORD)
+    {
+       report(stderr, GT_("POP2 only supports password authentication. Giving up.\n"));
+       return PS_AUTHFAIL;
+    }
+
     strlcpy(shroud, ctl->password, sizeof(shroud));
     status = gen_transact(sock,
                  "HELO %s %s",
                  ctl->remotename, ctl->password);
+    memset(shroud, 0x55, sizeof(shroud));
     shroud[0] = '\0';
     return status;
 }
 
 static int pop2_getrange(int sock, struct query *ctl, const char *folder, 
-                        int *countp, int *newp, int *bytes)
+                        int *countp, int *newp, unsigned long long *bytes)
 /* get range of messages to be fetched */
 {
     (void)ctl;