diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-11-04 05:58:19 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-11-04 05:58:19 +0000 |
commit | fd84b71d13951d2e72dc165f9f8736097e3ba4c2 (patch) | |
tree | 9b4bf8ca054567f75dc36363b195549b232d7eab /fetchmail.c | |
parent | 524a6e71a397f24e39afb42aa87c18277e6eddb0 (diff) | |
download | fetchmail-fd84b71d13951d2e72dc165f9f8736097e3ba4c2.tar.gz fetchmail-fd84b71d13951d2e72dc165f9f8736097e3ba4c2.tar.bz2 fetchmail-fd84b71d13951d2e72dc165f9f8736097e3ba4c2.zip |
Close SMTP sockets after each poll cycle to avoid MTA timeouts.
svn path=/trunk/; revision=472
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 15 |
1 files changed, 15 insertions, 0 deletions
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) |