X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=pop2.c;h=03d58a18f92334be44b0c57bd5774e1cf6893d18;hb=ecade79a63e9abad933e3705a02533620ddc92b5;hp=fe00cd6c1c4972bedcb16da6676d859bb5d0554a;hpb=3b4f5154753b18d70188dd373e8ca7818826ceee;p=~andy%2Ffetchmail diff --git a/pop2.c b/pop2.c index fe00cd6c..03d58a18 100644 --- a/pop2.c +++ b/pop2.c @@ -61,15 +61,24 @@ 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 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; }