X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a1067dea91a4cb3fc71b0b33271d2c7c9c8a2d7a..9389882b87260b964150ae7aa1949dcdbc2ef421:/uip/inc.c diff --git a/uip/inc.c b/uip/inc.c index f169fc7d..0e527442 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -29,7 +29,6 @@ #include #include #include - #include #include #include @@ -37,8 +36,6 @@ #include #include #include -#include -#include #ifndef CYRUS_SASL # define SASLminc(a) (a) @@ -190,7 +187,6 @@ main (int argc, char **argv) char *maildir_copy = NULL; /* copy of mail directory because the static gets overwritten */ int nmsgs, nbytes; - char *pass = NULL; char *MAILHOST_env_variable; done=inc_done; @@ -391,18 +387,14 @@ main (int argc, char **argv) * a POP server? */ if (inc_type == INC_POP) { - if (user == NULL) - user = getusername (); - if (sasl) - pass = getusername (); - else - ruserpass (host, &user, &pass); + struct nmh_creds creds = { 0, 0, 0 }; /* * initialize POP connection */ - if (pop_init (host, port, user, pass, proxy, snoop, sasl, - saslmech) == NOTOK) + nmh_get_credentials (host, user, sasl, &creds); + if (pop_init (host, port, creds.user, creds.password, proxy, snoop, + sasl, saslmech) == NOTOK) adios (NULL, "%s", response); /* Check if there are any messages */ @@ -555,10 +547,15 @@ go_to_it: else if (i == NOTOK) chmod (audfile, m_gmprot ()); - fprintf (aud, from ? "<> %s -ms %s\n" - : host ? "<> %s -host %s -user %s\n" - : "<> %s\n", - dtimenow (0), from ? from : host, user); + if (from) + fprintf (aud, "<> %s -ms %s\n", dtimenow(0), from); + else { + if (host) + fprintf (aud, "<> %s -host %s -user %s\n", dtimenow(0), + host, user); + else + fprintf (aud, "<> %s\n", dtimenow (0)); + } } /* Get new format string */