#if defined(HAVE_ALLOCA_H)
#include <alloca.h>
#endif
+#if defined(HAVE_SYS_ITIMER_H)
+#include <sys/itimer.h>
+#endif
#include <sys/time.h>
#include <signal.h>
"nameserver failure while looking for `%s' during poll of %s.",
name, ctl->server.names->id);
ctl->errcount++;
- longjmp(restart, 2); /* try again next poll cycle */
break;
}
"nameserver failure while looking for `%s' during poll of %s.",
name, ctl->server.names->id);
ctl->errcount++;
- longjmp(restart, 2); /* try again next poll cycle */
break;
}
}
#ifdef HAVE_RES_SEARCH
int no_local_matches = FALSE;
#endif /* HAVE_RES_SEARCH */
+ int olderrs;
sizeticker = 0;
delete_ok = TRUE;
remaining = len;
+ olderrs = ctl->errcount;
/* read message headers */
headers = received_for = return_path = NULL;
#endif /* HAVE_RES_SEARCH */
save_str(&xmit_names, -1, ctl->localnames->id);
- /* time to address the message */
- if (ctl->mda) /* we have a declared MDA */
+
+ /*
+ * Time to either address the message or decide we can't deliver it yet.
+ */
+ if (ctl->errcount > olderrs) /* there were DNS errors above */
+ {
+ delete_ok = FALSE;
+ sinkfp = (FILE *)NULL;
+ if (outlevel == O_VERBOSE)
+ error(0,0, "forwarding and deletion suppressed due to DNS errors");
+ }
+ else if (ctl->mda) /* we have a declared MDA */
{
int length = 0;
char *names, *cmd;
if (SMTP_eom(sinkfp) != SM_OK)
{
error(0, 0, "SMTP listener refused delivery");
+ ctl->errcount++;
return(PS_TRANSIENT);
}
}
ctl->server.timeout, ctl->server.names->id);
ok = PS_ERROR;
}
- else if (js == 2)
- {
- /* error message printed at point of longjmp */
- ok = PS_ERROR;
- }
else
{
char buf [POPBUFSIZE+1];