diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2009-05-25 12:35:54 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2009-05-25 12:35:54 +0000 |
commit | bd2e568da48acbae7e0b43c48226541220b85340 (patch) | |
tree | f60ee29a3e1d8897c3e2713af7442938ad89c8ec /sink.c | |
parent | b2f54f5fbf4c98a3e37003d5642eab20c3971432 (diff) | |
download | fetchmail-bd2e568da48acbae7e0b43c48226541220b85340.tar.gz fetchmail-bd2e568da48acbae7e0b43c48226541220b85340.tar.bz2 fetchmail-bd2e568da48acbae7e0b43c48226541220b85340.zip |
Enforce minimum recommended SMTP timeouts, apply to EHLO/LHLO as well.
Short timeouts could cause fetchmail to not wait long enough for the
"250 Ok" after shipping a long message, particularly with synchronous
mailers and extensive spam filtering. This caused fetchmail to re-fetch
long messages.
While the actual fix is making sure that the timeout is no shorter than
the time the SMTP server takes to process the message, we now enforce
the minimum RFC-5321 recommended timeouts even if the user configures a
lower timeout.
This is to fix Berlios Bug #10972, reported by Viktor Binzberger.
NOTE: it is untested whether we will properly delete the message from
the POP3/IMAP server or mark it as seen, as the upstream server may
close the connection sooner.
svn path=/branches/BRANCH_6-3/; revision=5338
Diffstat (limited to 'sink.c')
-rw-r--r-- | sink.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -158,7 +158,7 @@ int smtp_open(struct query *ctl) } /* first, probe for ESMTP */ - if (SMTP_ok(ctl->smtp_socket, ctl->smtphostmode) == SM_OK && + if (SMTP_ok(ctl->smtp_socket, ctl->smtphostmode, TIMEOUT_STARTSMTP) == SM_OK && SMTP_ehlo(ctl->smtp_socket, ctl->smtphostmode, id_me, ctl->server.esmtp_name, ctl->server.esmtp_password, &ctl->server.esmtp_options) == SM_OK) @@ -186,7 +186,7 @@ int smtp_open(struct query *ctl) } } - if (SMTP_ok(ctl->smtp_socket, ctl->smtphostmode) == SM_OK && + if (SMTP_ok(ctl->smtp_socket, ctl->smtphostmode, TIMEOUT_STARTSMTP) == SM_OK && SMTP_helo(ctl->smtp_socket, ctl->smtphostmode, id_me) == SM_OK) break; /* success */ @@ -282,7 +282,7 @@ static int send_bouncemail(struct query *ctl, struct msgblk *msg, if ((sock = SockOpen("localhost", SMTP_PORT, NULL, &ai1)) == -1) return(FALSE); - if (SMTP_ok(sock, SMTP_MODE) != SM_OK) + if (SMTP_ok(sock, SMTP_MODE, TIMEOUT_STARTSMTP) != SM_OK) { SockClose(sock); return FALSE; @@ -1422,7 +1422,7 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward) { if (lmtp_responses == 0) { - SMTP_ok(ctl->smtp_socket, ctl->smtphostmode); + SMTP_ok(ctl->smtp_socket, ctl->smtphostmode, TIMEOUT_EOM); /* * According to RFC2033, 503 is the only legal response @@ -1455,7 +1455,7 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward) responses = (char **)xmalloc(sizeof(char *) * lmtp_responses); for (errors = i = 0; i < lmtp_responses; i++) { - if ((smtp_err = SMTP_ok(ctl->smtp_socket, ctl->smtphostmode)) + if ((smtp_err = SMTP_ok(ctl->smtp_socket, ctl->smtphostmode, TIMEOUT_EOM)) == SM_UNRECOVERABLE) { smtp_close(ctl, 0); |