-
Notifications
You must be signed in to change notification settings - Fork 0
/
mailer_config.h
110 lines (85 loc) · 3.57 KB
/
mailer_config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* $Id$
*/
/* debug stuff */
#define STATUS 100 /* status every n messages */
#define DEBUG_SMTP /* SMTP deliver() debugging */
#undef DEBUG_SMTP_ALL /* debug ALL SMTP sessions (highly unrecommended!) */
#undef NO_FORK /* useful to debug deliver() */
#undef NO_DELIVERY /* fake delivery if defined */
#undef ERROR_MESSAGES /* generate error messages */
/* general params */
#define HEADER_HEADER "AWAD"
#define MPP "mpp"
/* bounces file name */
#define BOUNCE_FILE "mailer.bounces"
/* configuration file name */
#define CONFIG_FILE "mailer.config"
/* flags specified in config file */
typedef short flags_t;
#define FL_NONE (0x00)
#define FL_DEBUG (0x01)
#define FL_URL_BODY (0x02) /* add 'unsubscribe' url to the body */
/* these require USE_IDTAGS to be defined to have any effect */
#define FL_IDTAG_MSGID (0x10) /* unimplemented (on), see TWEAK_MSGID */
#define FL_IDTAG_RECV (0x20) /* unimplemented (on), see TWEAK_RCVHDR */
#define FL_IDTAG_FROM (0x40) /* unimplemented, see TWEAK_FROMADDR */
#define FL_IDTAG_BODY (0x80) /* works if TWEAK_BODY is defined */
/* default flags */
#define FL_DEFAULT (FL_IDTAG_MSGID|FL_IDTAG_RECV|FL_URL_BODY)
/* macros for setting/clearing/querying flags */
#define FLAGS_CLEAR(flags) (flags = 0)
#define FLAG_SET(flags,flag) (flags |= flag)
#define FLAG_UNSET(flags,flag) (flags &= ~flag)
#define FLAG_ISSET(flags,flag) (flags & flag)
#define BATCH_DEFAULT (-1)
/* use ID tags? */
#define USE_IDTAGS
#ifdef USE_IDTAGS
/* this will embed the current address number in the message-id */
#define TWEAK_MSGID
/* this will embed the id tag in the Received: header SMTP id */
#define TWEAK_RCVHDR
/* this will embed the message-id in the from address if batchsize==1 */
/* #define TWEAK_FROMADDR */
/* this will embed the message-id in the body if FL_IDTAG_BODY is set */
#define TWEAK_BODY
#endif /* USE_IDTAGS */
/* force single-recpient as well as related tweaks using To-address */
#define SINGLE_RECIPIENT
/* list processing parameters */
#define MAX_ADDR_LEN 256 /* single address size limit: RFC821 */
#define MAX_LINE_LEN 1024 /* single message line limit: RFC821 */
#define MAX_HOSTNAME_LEN 64 /* hostname limit: RFC821 */
#if 1
#define ADDRS_PER_BUF 100 /* max # of addresses per buffer: RFC821 */
#else
#define ADDRS_PER_BUF 64 /* msn.com won't take 100 though it should! */
#endif
#define BUFFER_LEN 4096 /* single delivery attempt buffer */
#define MAXMXHOSTS 20 /* max # of MX records */
/* scheduler parameters. these can be overridden in the config file. */
#define MAX_CHILD 90 /* max # of deliver children */
#define MIN_CHILD 15 /* min # of deliver children */
#define TARGET_RATE 10000 /* target rate in deliveries per hour */
/* SMTP: timeouts as defined in RFC1123 */
#define CONNECT_TIMEOUT 30 /* timeout for tcp connect() */
#define SMTP_TIMEOUT_WELCOME 60
#define SMTP_TIMEOUT_HELO 30 /* not defined in 1123 */
#define SMTP_TIMEOUT_MAIL 30
#define SMTP_TIMEOUT_RCPT 30
#define SMTP_TIMEOUT_DATA 120
#define SMTP_TIMEOUT_END 600
/* how long (in sec) to wait for children to finish at the end of processing */
#define END_WAIT_TIMEOUT (20 * 60)
/* this limits the overall length of the transaction, i.e. for problems we've
* seen with yahoo and hotmail where they have many MXs and they all time
* out. it is only checked prior to attempting delivery, so it may actually
* take longer than this if we're waiting on one of the other timeouts.
* the default value should allow us to try 3 addresses where connect()
* times out (30s) before giving up.
*/
#define TRANSACTION_TIMEOUT 75
#ifdef sun
#define memmove(D,S,L) bcopy(S,D,L)
#endif