X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=smtp.h;h=2f3f71faf99bb99c3b910b5692146fabed86b3f6;hb=edb8384a00f108b385d0df7ddfa5bd671a36f946;hp=8d27049b7eed59189c51d109da00c9438c3ceb09;hpb=a016460027f89e7c81106a0560d1d495f727c182;p=~andy%2Ffetchmail diff --git a/smtp.h b/smtp.h index 8d27049b..2f3f71fa 100644 --- a/smtp.h +++ b/smtp.h @@ -7,6 +7,8 @@ #ifndef _POPSMTP_ #define _POPSMTP_ +#include "config.h" + #define SMTPBUFSIZE 256 /* SMTP error values */ @@ -21,16 +23,27 @@ #define ESMTP_ATRN 0x08 /* used with ODMR, RFC 2645 */ #define ESMTP_AUTH 0x10 -void SMTP_setmode(char); -int SMTP_helo(int socket,const char *host); -int SMTP_ehlo(int socket,const char *host, char *name, char *passwd, int *opt); -int SMTP_from(int socket,const char *from,const char *opts); -int SMTP_rcpt(int socket,const char *to); -int SMTP_data(int socket); -int SMTP_eom(int socket); -int SMTP_rset(int socket); -int SMTP_quit(int socket); -int SMTP_ok(int socket); +/* 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); +int SMTP_ehlo(int socket, char smtp_mode, const char *host, char *name, char *passwd, int *opt); +int SMTP_from(int socket, char smtp_mode, const char *from,const char *opts); +int SMTP_rcpt(int socket, char smtp_mode, const char *to); +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 mintimeout); extern char smtp_response[MSGBUFSIZE];