From fd84b71d13951d2e72dc165f9f8736097e3ba4c2 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 4 Nov 1996 05:58:19 +0000 Subject: Close SMTP sockets after each poll cycle to avoid MTA timeouts. svn path=/trunk/; revision=472 --- fetchmail.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index b731b2a7..5bbe37f8 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -308,6 +308,21 @@ char **argv; endhostent(); /* release TCP/IP connection to nameserver */ #endif /* HAVE_GETHOSTBYNAME */ + /* + * Close all SMTP delivery sockets. For optimum performance + * we'd like to hold them open til end of run, but (1) this + * loses if our poll interval is longer than the MTA's inactivity + * timeout, and (2) some MTAs (like smail) don't deliver after + * each message, but rather queue up mail and wait to actually + * deliver it until the input socket is closed. + */ + for (ctl = querylist; ctl; ctl = ctl->next) + if (ctl->smtp_sockfp) + { + fclose(ctl->smtp_sockfp); + ctl->smtp_sockfp = (FILE *)NULL; + } + if (poll_interval) { if (outlevel == O_VERBOSE) -- cgit v1.2.3