aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-08-17 17:51:32 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-08-17 17:51:32 +0000
commit7c3a0f3a090339ac22e2ace55eab03575f708273 (patch)
treeb5e6edf00583828f0083de4ccb18db25fa48c739 /fetchmail.c
parent7785b91fb6a49cab6927634d2c1997b47a4bf406 (diff)
downloadfetchmail-7c3a0f3a090339ac22e2ace55eab03575f708273.tar.gz
fetchmail-7c3a0f3a090339ac22e2ace55eab03575f708273.tar.bz2
fetchmail-7c3a0f3a090339ac22e2ace55eab03575f708273.zip
Changes from the road.
svn path=/trunk/; revision=2540
Diffstat (limited to 'fetchmail.c')
-rw-r--r--fetchmail.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/fetchmail.c b/fetchmail.c
index de0977f3..ee790597 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -16,6 +16,7 @@
#include <fcntl.h>
#include <string.h>
#include <signal.h>
+#include <getopt.h>
#if defined(HAVE_SYSLOG)
#include <syslog.h>
#endif
@@ -32,7 +33,7 @@
#endif /* HAVE_SETRLIMIT */
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
-#endif
+#endif /* HAVE_SYS_WAIT_H */
#ifdef HAVE_GETHOSTBYNAME
#include <netdb.h>
@@ -272,11 +273,14 @@ int main(int argc, char **argv)
}
#endif /* HAVE_SETRLIMIT */
+#define NETRC_FILE ".netrc"
/* parse the ~/.netrc file (if present) for future password lookups. */
- xalloca(netrc_file, char *, strlen (home) + 8);
+ xalloca(netrc_file, char *, strlen (home) + strlen(NETRC_FILE) + 2);
strcpy (netrc_file, home);
- strcat (netrc_file, "/.netrc");
+ strcat (netrc_file, "/");
+ strcat (netrc_file, NETRC_FILE);
netrc_list = parse_netrc(netrc_file);
+#undef NETRC_FILE
/* pick up passwords where we can */
for (ctl = querylist; ctl; ctl = ctl->next)
@@ -1391,19 +1395,26 @@ static void dump_params (struct runctl *runp,
* Don't poll for password when there is one or when using the ETRN
* or IMAP-GSS protocol
*/
- if (!ctl->password && (ctl->server.protocol != P_ETRN)
+ /* ETRN, IMAP_GSS, and IMAP_K4 do not need a password, so skip this */
+ if ( (ctl->server.protocol != P_ETRN)
#ifdef GSSAPI
- && (ctl->server.protocol != P_IMAP_GSS)
+ && (ctl->server.protocol != P_IMAP_GSS)
#endif /* GSSAPI */
- && ctl->server.protocol != P_IMAP_K4)
- printf(_(" Password will be prompted for.\n"));
- else if (outlevel >= O_VERBOSE)
- if (ctl->server.protocol == P_APOP)
- printf(_(" APOP secret = \"%s\".\n"), visbuf(ctl->password));
- else if (ctl->server.protocol == P_RPOP)
- printf(_(" RPOP id = \"%s\".\n"), visbuf(ctl->password));
- else
- printf(_(" Password = \"%s\".\n"), visbuf(ctl->password));
+ && (ctl->server.protocol != P_IMAP_K4) ) {
+ if (!ctl->password)
+ printf(_(" Password will be prompted for.\n"));
+ else if (outlevel >= O_VERBOSE)
+ if (ctl->server.protocol == P_APOP)
+ printf(_(" APOP secret = \"%s\".\n"),
+ visbuf(ctl->password));
+ else if (ctl->server.protocol == P_RPOP)
+ printf(_(" RPOP id = \"%s\".\n"),
+ visbuf(ctl->password));
+ else
+ printf(_(" Password = \"%s\".\n"),
+ visbuf(ctl->password));
+ }
+
if (ctl->server.protocol == P_POP3
#if INET6
&& !strcmp(ctl->server.service, KPOP_PORT)