comparison src/context.h @ 192:8f4a9a37d4d9

delay autowhitelisting to avoid out of office reply bots
author carl
date Sun, 11 Nov 2007 12:49:25 -0800
parents 8b86a894514d
children 82886d4dd71f
comparison
equal deleted inserted replaced
191:2a67d31099c3 192:8f4a9a37d4d9
22 class DNSBL; 22 class DNSBL;
23 class CONTEXT; 23 class CONTEXT;
24 class VERIFY; 24 class VERIFY;
25 class SMTP; 25 class SMTP;
26 class WHITELISTER; 26 class WHITELISTER;
27 class DELAYWHITE;
27 class recorder; 28 class recorder;
28 29
29 typedef map<char *, char *, ltstr> string_map; 30 typedef map<char *, char *, ltstr> string_map;
30 typedef set<int> int_set; 31 typedef set<int> int_set;
31 typedef list<SMTP *> smtp_list; 32 typedef list<SMTP *> smtp_list;
32 typedef list<char *> string_list; 33 typedef list<char *> string_list;
33 typedef DNSBL * DNSBLP; 34 typedef DNSBL * DNSBLP;
34 typedef VERIFY * VERIFYP; 35 typedef VERIFY * VERIFYP;
35 typedef WHITELISTER * WHITELISTERP; 36 typedef WHITELISTER * WHITELISTERP;
37 typedef DELAYWHITE * DELAYWHITEP;
36 typedef list<DNSBLP> dnsblp_list; 38 typedef list<DNSBLP> dnsblp_list;
37 typedef map<char *, DNSBLP, ltstr> dnsblp_map; 39 typedef map<char *, DNSBLP, ltstr> dnsblp_map;
38 typedef CONTEXT * CONTEXTP; 40 typedef CONTEXT * CONTEXTP;
39 typedef list<CONTEXTP> context_list; 41 typedef list<CONTEXTP> context_list;
40 typedef map<char *, CONTEXTP, ltstr> context_map; 42 typedef map<char *, CONTEXTP, ltstr> context_map;
41 typedef map<char *, int, ltstr> ns_mapper; 43 typedef map<char *, int, ltstr> ns_mapper;
42 typedef map<char *, int, ltstr> rcpt_rates; 44 typedef map<char *, int, ltstr> rcpt_rates;
43 typedef map<char *, time_t, ltstr> autowhite_sent; 45 typedef map<char *, time_t, ltstr> autowhite_sent;
44 typedef map<char *, VERIFYP, ltstr> verify_map; 46 typedef map<char *, VERIFYP, ltstr> verify_map;
45 typedef map<char *, WHITELISTERP, ltstr> whitelister_map; 47 typedef map<char *, WHITELISTERP, ltstr> whitelister_map;
48 typedef list<DELAYWHITEP> delay_whitelist;
46 49
47 class SMTP { 50 class SMTP {
48 static const int maxlen = 1000; 51 static const int maxlen = 1000;
49 int fd; 52 int fd;
50 bool error; 53 bool error;
105 void writer(); // dump any changes back to the file 108 void writer(); // dump any changes back to the file
106 void sent(char *to); 109 void sent(char *to);
107 bool is_white(char *from); // should we white list this sender (did we send them anything recently) 110 bool is_white(char *from); // should we white list this sender (did we send them anything recently)
108 int get_days() {return days;}; 111 int get_days() {return days;};
109 void set_days(int d) {days = d;}; 112 void set_days(int d) {days = d;};
113 };
114
115 class DELAYWHITE {
116 char* loto;
117 WHITELISTERP w;
118 CONTEXTP con;
119 public:
120 DELAYWHITE(char *loto_, WHITELISTERP w_, CONTEXTP con_);
121 char *get_loto() {return loto;};
122 WHITELISTERP get_w() {return w;};
123 CONTEXTP get_con() {return con;};
110 }; 124 };
111 125
112 struct DNSBL { 126 struct DNSBL {
113 char *name; // nickname for this dns based list 127 char *name; // nickname for this dns based list
114 char *suffix; // blacklist suffix like blackholes.five-ten-sg.com 128 char *suffix; // blacklist suffix like blackholes.five-ten-sg.com
259 void add_to(char *to, CONTEXTP con); 273 void add_to(char *to, CONTEXTP con);
260 CONTEXTP find_context(char *to); 274 CONTEXTP find_context(char *to);
261 void dump(); 275 void dump();
262 }; 276 };
263 277
264 struct RATELIMIT {
265
266 };
267 278
268 extern char *token_autowhite; 279 extern char *token_autowhite;
269 extern char *token_black; 280 extern char *token_black;
270 extern char *token_cctld; 281 extern char *token_cctld;
271 extern char *token_content; 282 extern char *token_content;