diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | fetchmail.c | 20 |
2 files changed, 21 insertions, 1 deletions
@@ -6,6 +6,8 @@ * Bug fix for envskip. * ODMR finally seems to be working. * Handle multiple backslashes within RFC822 address strings correctly. +* Don't exit on a failure to DNS-resolve a mailserver name, just + make it inactive. Exit only if all lookups fail. * Restore code to deal with SMTP error responses at RCPT TO time, but without issuing an RSET. This is intended to fix obscure bugs that show up in recentb Postfix releases and sendmail configurations that 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); } |