diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-07-06 02:10:04 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-07-06 02:10:04 +0000 |
commit | 9efaf6e9906c97c30244293393239644416daa8b (patch) | |
tree | cb1369380a3f1d5d57755fcf61c2d38b1748c9e8 /fetchmail.c | |
parent | bf0c8e9b59052d97037f5412ee4e9e37bb6281cc (diff) | |
download | fetchmail-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.c | 20 |
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); } |