| 1 |
/* |
| 2 |
* smtp.h -- prototypes for smtp handling code |
| 3 |
* |
| 4 |
* For license terms, see the file COPYING in this directory. |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef _POPSMTP_ |
| 8 |
#define _POPSMTP_ |
| 9 |
|
| 10 |
#include "config.h" |
| 11 |
|
| 12 |
#define SMTPBUFSIZE 256 |
| 13 |
|
| 14 |
/* SMTP error values */ |
| 15 |
#define SM_OK 0 |
| 16 |
#define SM_ERROR 128 |
| 17 |
#define SM_UNRECOVERABLE 129 |
| 18 |
|
| 19 |
/* ESMTP extension option masks (not all options are listed here) */ |
| 20 |
#define ESMTP_8BITMIME 0x01 |
| 21 |
#define ESMTP_SIZE 0x02 |
| 22 |
#define ESMTP_ETRN 0x04 |
| 23 |
#define ESMTP_ATRN 0x08 /* used with ODMR, RFC 2645 */ |
| 24 |
#define ESMTP_AUTH 0x10 |
| 25 |
|
| 26 |
/* SMTP timeouts (seconds) - SHOULD clauses from RFC-5321 sec. 4.5.3.2. */ |
| 27 |
#define TIMEOUT_STARTSMTP 300 |
| 28 |
#define TIMEOUT_HELO 300 /* not in RFC-5321, also for EHLO/LHLO */ |
| 29 |
#define TIMEOUT_MAIL 300 |
| 30 |
#define TIMEOUT_RCPT 300 |
| 31 |
#define TIMEOUT_DATA 120 |
| 32 |
#define TIMEOUT_DATALINE 180 |
| 33 |
#define TIMEOUT_EOM 600 |
| 34 |
#define TIMEOUT_DEFAULT 300 /* not in RFC-5321, all other client timeouts */ |
| 35 |
|
| 36 |
extern time_t last_smtp_ok; |
| 37 |
|
| 38 |
int SMTP_helo(int socket, char smtp_mode, const char *host); |
| 39 |
int SMTP_ehlo(int socket, char smtp_mode, const char *host, char *name, char *passwd, int *opt); |
| 40 |
int SMTP_from(int socket, char smtp_mode, const char *from,const char *opts); |
| 41 |
int SMTP_rcpt(int socket, char smtp_mode, const char *to); |
| 42 |
int SMTP_data(int socket, char smtp_mode); |
| 43 |
int SMTP_eom(int socket, char smtp_mode); |
| 44 |
int SMTP_rset(int socket, char smtp_mode); |
| 45 |
int SMTP_quit(int socket, char smtp_mode); |
| 46 |
int SMTP_ok(int socket, char smtp_mode, int mintimeout); |
| 47 |
|
| 48 |
extern char smtp_response[MSGBUFSIZE]; |
| 49 |
|
| 50 |
#endif |