#define TRMLEN (sizeof TRM - 1)
static int poprint = 0;
-static int pophack = 0;
char response[BUFSIZ];
static netsec_context *nsc = NULL;
}
int
-pop_init (char *host, char *port, char *user, char *pass, char *proxy,
- int snoop, int sasl, char *mech, int tls, const char *oauth_svc)
+pop_init (char *host, char *port, char *user, char *proxy, int snoop,
+ int sasl, char *mech, int tls, const char *oauth_svc)
{
int fd1, fd2;
char buffer[BUFSIZ];
return NOTOK;
}
return OK;
- } else
- if (command ("USER %s", user) != NOTOK
- && command ("%s %s", (pophack++, "PASS"),
- pass) != NOTOK)
- return OK;
+ } else {
+ nmh_creds_t creds;
+
+ if (!(creds = nmh_get_credentials(host, user)))
+ return NOTOK;
+ if (command ("USER %s", nmh_cred_get_user(creds))
+ != NOTOK) {
+ if (command("PASS %s", nmh_cred_get_password(creds))
+ != NOTOK) {
+ nmh_credentials_free(creds);
+ return OK;
+ }
+ }
+ nmh_credentials_free(creds);
+ }
}
strncpy (buffer, response, sizeof(buffer));
command ("QUIT");