aboutsummaryrefslogtreecommitdiffstats
path: root/smtp.h
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2009-05-25 12:35:54 +0000
committerMatthias Andree <matthias.andree@gmx.de>2009-05-25 12:35:54 +0000
commitbd2e568da48acbae7e0b43c48226541220b85340 (patch)
treef60ee29a3e1d8897c3e2713af7442938ad89c8ec /smtp.h
parentb2f54f5fbf4c98a3e37003d5642eab20c3971432 (diff)
downloadfetchmail-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 'smtp.h')
-rw-r--r--smtp.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/smtp.h b/smtp.h
index b65196a7..2f3f71fa 100644
--- a/smtp.h
+++ b/smtp.h
@@ -23,6 +23,16 @@
#define ESMTP_ATRN 0x08 /* used with ODMR, RFC 2645 */
#define ESMTP_AUTH 0x10
+/* SMTP timeouts (seconds) - SHOULD clauses from RFC-5321 sec. 4.5.3.2. */
+#define TIMEOUT_STARTSMTP 300
+#define TIMEOUT_HELO 300 /* not in RFC-5321, also for EHLO/LHLO */
+#define TIMEOUT_MAIL 300
+#define TIMEOUT_RCPT 300
+#define TIMEOUT_DATA 120
+#define TIMEOUT_DATALINE 180
+#define TIMEOUT_EOM 600
+#define TIMEOUT_DEFAULT 300 /* not in RFC-5321, all other client timeouts */
+
extern time_t last_smtp_ok;
int SMTP_helo(int socket, char smtp_mode, const char *host);
@@ -33,7 +43,7 @@ int SMTP_data(int socket, char smtp_mode);
int SMTP_eom(int socket, char smtp_mode);
int SMTP_rset(int socket, char smtp_mode);
int SMTP_quit(int socket, char smtp_mode);
-int SMTP_ok(int socket, char smtp_mode);
+int SMTP_ok(int socket, char smtp_mode, int mintimeout);
extern char smtp_response[MSGBUFSIZE];