aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-07-06 02:10:04 +0000
committerEric S. Raymond <esr@thyrsus.com>2001-07-06 02:10:04 +0000
commit9efaf6e9906c97c30244293393239644416daa8b (patch)
treecb1369380a3f1d5d57755fcf61c2d38b1748c9e8 /fetchmail.c
parentbf0c8e9b59052d97037f5412ee4e9e37bb6281cc (diff)
downloadfetchmail-9efaf6e9906c97c30244293393239644416daa8b.tar.gz
fetchmail-9efaf6e9906c97c30244293393239644416daa8b.tar.bz2
fetchmail-9efaf6e9906c97c30244293393239644416daa8b.zip
Exit with DNS error only if all mailserver lookups fail.
svn path=/trunk/; revision=3401
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);
}