aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
Diffstat (limited to 'fetchmail.c')
-rw-r--r--fetchmail.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/fetchmail.c b/fetchmail.c
index 37fe3e1c..bac5a2f7 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -1169,7 +1169,10 @@ static int load_params(int argc, char **argv, int optind)
report(stderr,
_("couldn't find canonical DNS name of %s\n"),
ctl->server.pollname);
- exit(PS_DNS);
+ ctl->server.truename = xstrdup(ctl->server.queryname);
+ ctl->active = FALSE;
+ /* use this initially to flag DNS errors */
+ ctl->wedged = TRUE;
}
else {
ctl->server.truename=xstrdup((char *)namerec->h_name);
@@ -1267,6 +1270,21 @@ static int load_params(int argc, char **argv, int optind)
run.postmaster = "postmaster";
}
+ /*
+ * If all connections are wedged due to DNS errors, quit. This is
+ * important for the common case that you just have one connection.
+ */
+ st = PS_DNS;
+ for (ctl = querylist; ctl; ctl = ctl->next)
+ if (!ctl->wedged)
+ st = 0;
+ if (st == PS_DNS)
+ {
+ (void) fprintf(stderr,
+ _("all mailserver name lookups failed, exiting\n"));
+ exit(PS_DNS);
+ }
+
return(implicitmode);
}