Mercurial > dnsbl
annotate src/context.h @ 250:3218ab6af599
need --add-missing for newer systems
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sun, 08 Apr 2012 11:47:45 -0700 |
parents | 15bf4f68a0b2 |
children | d6d5c50b9278 |
rev | line source |
---|---|
143 | 1 /* |
2 | |
152 | 3 Copyright (c) 2007 Carl Byington - 510 Software Group, released under |
4 the GPL version 3 or any later version at your choice available at | |
5 http://www.gnu.org/licenses/gpl-3.0.txt | |
143 | 6 |
7 */ | |
8 | |
94 | 9 #ifndef context_include |
10 #define context_include | |
11 | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
12 enum status {oksofar, // not rejected yet |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
13 white, // whitelisted |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
14 black, // blacklisted |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
15 reject}; // rejected by a dns list |
94 | 16 |
17 class DNSBL; | |
249 | 18 class DNSWL; |
94 | 19 class CONTEXT; |
20 class VERIFY; | |
21 class SMTP; | |
153 | 22 class WHITELISTER; |
192
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
179
diff
changeset
|
23 class DELAYWHITE; |
94 | 24 class recorder; |
25 | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
26 typedef map<const char *, const char *, ltstr> string_map; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
27 typedef set<int> int_set; |
242
d8ee4c97b9ab
64 bit fixes for libresolv.a
Carl Byington <carl@five-ten-sg.com>
parents:
233
diff
changeset
|
28 typedef set<int32_t> int32_t_set; |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
29 typedef list<SMTP *> smtp_list; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
30 typedef DNSBL * DNSBLP; |
249 | 31 typedef DNSWL * DNSWLP; |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
32 typedef VERIFY * VERIFYP; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
33 typedef WHITELISTER * WHITELISTERP; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
34 typedef DELAYWHITE * DELAYWHITEP; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
35 typedef list<DNSBLP> dnsblp_list; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
36 typedef map<const char *, DNSBLP, ltstr> dnsblp_map; |
249 | 37 typedef list<DNSWLP> dnswlp_list; |
38 typedef map<const char *, DNSWLP, ltstr> dnswlp_map; | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
39 typedef CONTEXT * CONTEXTP; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
40 typedef list<CONTEXTP> context_list; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
41 typedef map<const char *, CONTEXTP, ltstr> context_map; |
242
d8ee4c97b9ab
64 bit fixes for libresolv.a
Carl Byington <carl@five-ten-sg.com>
parents:
233
diff
changeset
|
42 typedef map<const char *, int32_t, ltstr> ns_mapper; // name to ipv4 address |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
43 typedef map<const char *, int, ltstr> rcpt_rates; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
44 typedef map<const char *, time_t, ltstr> autowhite_sent; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
45 typedef map<const char *, VERIFYP, ltstr> verify_map; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
46 typedef map<const char *, WHITELISTERP, ltstr> whitelister_map; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
47 typedef list<DELAYWHITEP> delay_whitelist; |
94 | 48 |
49 class SMTP { | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
50 static const int maxlen = 1000; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
51 int fd; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
52 bool error; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
53 time_t stamp; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
54 char efrom[maxlen]; // last envelope from sent on this socket |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
55 int pending; // unread bytes in buffer, not including the null terminator |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
56 char buffer[maxlen]; |
94 | 57 public: |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
58 SMTP(int f) {fd = f; error = false; now(); efrom[0] = '\0'; init();}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
59 ~SMTP() {if (!error) quit(); closefd();}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
60 void init() {pending = 0; buffer[0] = '\0';}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
61 void append(const char *c) {strncat(buffer, c, max(0, maxlen-1-(int)strlen(c)));}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
62 bool err() {return error;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
63 void now() {stamp = time(NULL);}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
64 time_t get_stamp() {return stamp;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
65 int get_fd() {return fd;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
66 int writer(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
67 int reader(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
68 int read_line(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
69 int read_response(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
70 void flush_line(int r); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
71 int cmd(const char *c); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
72 int helo(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
73 int rset(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
74 int from(const char *f); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
75 int rcpt(const char *t); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
76 int quit(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
77 void closefd(); |
94 | 78 #ifdef VERIFY_DEBUG |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
79 static void log(const char *m, int v); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
80 static void log(const char *m, const char *v); |
94 | 81 #endif |
82 }; | |
83 | |
84 class VERIFY { | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
85 const char *host; // host to be used to verify recipient addresses |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
86 time_t last_err; // time of last socket error |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
87 pthread_mutex_t mutex; // protect the lists of sockets and timestamps |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
88 smtp_list connections;// open sockets, ready to be used |
94 | 89 public: |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
90 VERIFY(const char *h); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
91 void closer(); // if the oldest socket is ancient, close it |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
92 SMTP *get_connection(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
93 void put_connection(SMTP *conn); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
94 bool ok(const char *from, const char *to); |
94 | 95 }; |
96 | |
153 | 97 class WHITELISTER { |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
98 const char *fn; // file to use |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
99 int days; // how long do we keep entries |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
100 pthread_mutex_t mutex; // protect the flag and map |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
101 time_t loaded; // when we loaded this file |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
102 bool need; // force writing on new entries |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
103 autowhite_sent rcpts; // recipient map to remember when we sent them mail |
153 | 104 public: |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
105 WHITELISTER(const char *f, int d); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
106 void merge(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
107 void writer(); // dump any changes back to the file |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
108 void sent(const char *to); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
109 bool is_white(const char *from); // should we white list this sender (did we send them anything recently) |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
110 int get_days() {return days;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
111 void set_days(int d) {days = d;}; |
153 | 112 }; |
113 | |
192
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
179
diff
changeset
|
114 class DELAYWHITE { |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
115 const char *loto; |
192
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
179
diff
changeset
|
116 WHITELISTERP w; |
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
179
diff
changeset
|
117 CONTEXTP con; |
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
179
diff
changeset
|
118 public: |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
119 DELAYWHITE(const char *loto_, WHITELISTERP w_, CONTEXTP con_); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
120 const char *get_loto() {return loto;}; |
192
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
179
diff
changeset
|
121 WHITELISTERP get_w() {return w;}; |
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
179
diff
changeset
|
122 CONTEXTP get_con() {return con;}; |
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
179
diff
changeset
|
123 }; |
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
179
diff
changeset
|
124 |
94 | 125 struct DNSBL { |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
126 const char *name; // nickname for this dns based list |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
127 const char *suffix; // blacklist suffix like blackholes.five-ten-sg.com |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
128 const char *message; // error message with one or two %s operators for the ip address replacement |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
129 DNSBL(const char *n, const char *s, const char *m); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
130 bool operator==(const DNSBL &rhs); |
94 | 131 }; |
132 | |
249 | 133 struct DNSWL { |
134 const char *name; // nickname for this dns based list | |
135 const char *suffix; // whitelist suffix like list.dnswl.org | |
136 int level; // matches 127.0.x.y where y >= level | |
137 DNSWL(const char *n, const char *s, const int l); | |
138 bool operator==(const DNSWL &rhs); | |
139 }; | |
140 | |
94 | 141 class CONTEXT { |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
142 CONTEXTP parent; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
143 const char * name; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
144 context_map children; // map child context names to their contexts |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
145 string_set env_to; // this context applies to these envelope recipients |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
146 const char * verify_host; // use this smtp host to verify email addresses |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
147 VERIFYP verifier; // pointer to the verifier structure |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
148 const char * generic_regx; // pointer to generic regular expression |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
149 const char * generic_message; // pointer to generic message with one %s |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
150 regex_t generic_pattern; // compiled regex pattern |
233
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
214
diff
changeset
|
151 const char * white_regx; // pointer to whitelist regular expression |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
214
diff
changeset
|
152 regex_t white_pattern; // compiled regex pattern |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
153 const char * autowhite_file; // file to use for automatic whitelisting |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
154 WHITELISTERP whitelister; // pointer to the auto whitelister structure |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
155 string_map env_from; // map senders to white/black/unknown |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
156 context_map env_from_context; // map senders to a child context |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
157 const char * env_from_default; // default value for senders that are not found in the map white/black/unknown/inherit |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
158 bool content_filtering; // |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
159 const char * content_suffix; // for url body filtering based on ip addresses of hostnames in the body |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
160 const char * content_message; // "" |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
161 const char * uribl_suffix; // for uribl body filtering based on hostnames in the body |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
162 const char * uribl_message; // "" |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
163 string_set content_host_ignore;// hosts to ignore for content sbl checking |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
164 string_set content_tlds; // |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
165 string_set content_cctlds; // |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
166 string_set html_tags; // set of valid html tags |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
167 int host_limit; // limit on host names |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
168 const char * host_limit_message; // error message for excessive host names |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
169 bool host_random; // pick a random selection of host names rather than error for excessive hosts |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
170 int tag_limit; // limit on bad html tags |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
171 const char * tag_limit_message; // error message for excessive bad html tags |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
172 int spamassassin_limit; // max score from spamassassin |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
173 bool require_match; // require matching context filtering context |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
174 bool dcc_greylist; // should we do dcc greylisting? |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
175 int dcc_bulk_threshold; // off = 0, many = 1000 |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
176 dnsblp_map dnsbl_names; // name to dnsbl mapping for lists that are available in this context and children |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
177 dnsblp_list dnsbl_list; // list of dnsbls to be used in this context |
249 | 178 dnswlp_map dnswl_names; // name to dnswl mapping for lists that are available in this context and children |
179 dnswlp_list dnswl_list; // list of dnswls to be used in this context | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
180 int default_rcpt_rate; // if not specified per user |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
181 rcpt_rates rcpt_per_hour; // per user limits on number of recipients per hour |
136 | 182 |
94 | 183 |
184 public: | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
185 CONTEXT(CONTEXTP parent_, const char *name_); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
186 ~CONTEXT(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
187 CONTEXTP get_parent() {return parent;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
188 bool is_parent(CONTEXTP p); // is p a parent of this? |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
189 const char* get_full_name(char *buffer, int size); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
190 void add_context(CONTEXTP child) {children[child->name] = child;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
191 bool allow_env_to(const char *to) {return (parent) ? parent->cover_env_to(to) : true;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
192 bool cover_env_to(const char *to); |
94 | 193 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
194 void set_verifier(VERIFYP v) {verifier = v;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
195 void set_verify(const char *host) {verify_host = host;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
196 const char* get_verify() {return verify_host;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
197 VERIFYP find_verify(const char *to); |
94 | 198 |
168 | 199 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
200 void set_whitelister(WHITELISTERP v) {whitelister = v;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
201 void set_autowhite(const char *fn) {autowhite_file = fn;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
202 const char* get_autowhite() {return autowhite_file;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
203 WHITELISTERP find_autowhite(const char *from, const char *to); |
153 | 204 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
205 void set_default_rate(int limit) {default_rcpt_rate = limit;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
206 void add_rate(const char *user, int limit) {rcpt_per_hour[user] = limit;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
207 int find_rate(const char *user); |
136 | 208 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
209 void add_to(const char *to) {env_to.insert(to);}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
210 void add_from(const char *from, const char *status) {env_from[from] = status;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
211 void add_from_context(const char *from, CONTEXTP con) {env_from_context[from] = con;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
212 void set_from_default(const char *status) {env_from_default = status;}; |
233
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
214
diff
changeset
|
213 const char* find_from(const char *from, bool update_white = false, const char *queueid = NULL); |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
214 CONTEXTP find_context(const char *from); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
215 CONTEXTP find_from_context_name(const char *name); |
94 | 216 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
217 void set_content_filtering(bool filter) {content_filtering = filter; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
218 void set_content_suffix(const char *suffix) {content_suffix = suffix; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
219 void set_content_message(const char *message) {content_message = message; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
220 void set_uribl_suffix(const char *suffix) {uribl_suffix = suffix; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
221 void set_uribl_message(const char *message) {uribl_message = message; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
222 void add_ignore(const char *host) {content_host_ignore.insert(host);}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
223 void add_tld(const char *tld) {content_tlds.insert(tld); }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
224 void add_cctld(const char *cctld) {content_cctlds.insert(cctld); }; |
94 | 225 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
226 void set_host_limit(int limit) {host_limit = limit; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
227 void set_host_message(const char *message) {host_limit_message = message;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
228 void set_host_random(bool random) {host_random = random; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
229 void set_spamassassin_limit(int limit) {spamassassin_limit = limit; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
230 void set_tag_limit(int limit) {tag_limit = limit; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
231 void set_tag_message(const char *message) {tag_limit_message = message;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
232 void add_tag(const char *tag) {html_tags.insert(tag); }; |
94 | 233 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
234 void add_dnsbl(const char *name, DNSBLP dns) {dnsbl_names[name] = dns; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
235 void add_dnsbl(DNSBLP dns) {dnsbl_list.push_back(dns);}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
236 DNSBLP find_dnsbl(const char *name); |
94 | 237 |
249 | 238 void add_dnswl(const char *name, DNSWLP dns) {dnswl_names[name] = dns; }; |
239 void add_dnswl(DNSWLP dns) {dnswl_list.push_back(dns);}; | |
240 DNSWLP find_dnswl(const char *name); | |
241 | |
233
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
214
diff
changeset
|
242 bool set_white(const char *regx); |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
214
diff
changeset
|
243 bool white_match(const char *from); |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
214
diff
changeset
|
244 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
245 bool set_generic(const char *regx, const char *msg); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
246 const char* generic_match(const char *client); |
168 | 247 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
248 void set_require(bool r) {require_match = r; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
249 void set_grey(bool g) {dcc_greylist = g; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
250 void set_bulk(int b) {dcc_bulk_threshold = b; }; |
178 | 251 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
252 bool get_content_filtering() {return content_filtering; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
253 bool get_require() {return content_filtering && require_match; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
254 bool get_grey() {return content_filtering && dcc_greylist; }; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
255 int get_bulk() {return (content_filtering) ? dcc_bulk_threshold : 0;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
256 int get_host_limit() {return (content_filtering) ? host_limit : 0;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
257 bool get_host_random() {return (content_filtering) ? host_random : 0;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
258 int get_spamassassin_limit() {return (content_filtering) ? spamassassin_limit : 0;}; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
259 const char* get_content_suffix(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
260 const char* get_content_message(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
261 const char* get_uribl_suffix(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
262 const char* get_uribl_message(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
263 string_set& get_content_host_ignore(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
264 string_set& get_content_tlds(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
265 string_set& get_content_cctlds(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
266 string_set& get_html_tags(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
267 dnsblp_list& get_dnsbl_list(); |
249 | 268 dnswlp_list& get_dnswl_list(); |
94 | 269 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
270 bool acceptable_content(recorder &memory, int score, int bulk, string& msg); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
271 bool ignore_host(const char *host); |
94 | 272 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
273 void dump(bool isdefault, bool &spamass, int level = 0); |
94 | 274 }; |
275 | |
276 | |
277 struct CONFIG { | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
278 // the only mutable stuff once it has been loaded from the config file |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
279 int reference_count; // protected by the global config_mutex |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
280 // all the rest is constant after loading from the config file |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
281 int generation; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
282 time_t load_time; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
283 string_set config_files; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
284 context_list contexts; // owns all the contexts, not just top level contexts |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
285 context_map env_to; // map recipient to a filtering context |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
286 CONTEXTP default_context;// for env_to values that don't have their own specific filtering context |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
287 // the default context is also used for some of the content filtering values |
94 | 288 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
289 CONFIG(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
290 ~CONFIG(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
291 void add_context(CONTEXTP con); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
292 void add_to(const char *to, CONTEXTP con); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
293 CONTEXTP find_context(const char *to); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
294 void dump(); |
94 | 295 }; |
296 | |
136 | 297 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
298 extern const char *token_autowhite; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
299 extern const char *token_black; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
300 extern const char *token_cctld; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
301 extern const char *token_content; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
302 extern const char *token_context; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
303 extern const char *token_dccbulk; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
304 extern const char *token_dccfrom; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
305 extern const char *token_dccgrey; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
306 extern const char *token_dccto; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
307 extern const char *token_default; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
308 extern const char *token_dnsbl; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
309 extern const char *token_dnsbll; |
249 | 310 extern const char *token_dnswl; |
311 extern const char *token_dnswll; | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
312 extern const char *token_envfrom; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
313 extern const char *token_envto; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
314 extern const char *token_filter; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
315 extern const char *token_generic; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
316 extern const char *token_host_limit; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
317 extern const char *token_html_limit; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
318 extern const char *token_html_tags; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
319 extern const char *token_ignore; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
320 extern const char *token_include; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
321 extern const char *token_inherit; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
322 extern const char *token_lbrace; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
323 extern const char *token_mailhost; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
324 extern const char *token_many; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
325 extern const char *token_no; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
326 extern const char *token_off; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
327 extern const char *token_ok; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
328 extern const char *token_ok2; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
329 extern const char *token_on; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
330 extern const char *token_rate; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
331 extern const char *token_rbrace; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
332 extern const char *token_require; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
333 extern const char *token_semi; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
334 extern const char *token_soft; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
335 extern const char *token_spamassassin; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
336 extern const char *token_substitute; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
337 extern const char *token_tld; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
338 extern const char *token_unknown; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
339 extern const char *token_uribl; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
340 extern const char *token_verify; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
341 extern const char *token_white; |
233
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
214
diff
changeset
|
342 extern const char *token_white_regex; |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
343 extern const char *token_yes; |
94 | 344 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
345 extern pthread_mutex_t verifier_mutex; // protect the verifier map |
153 | 346 extern pthread_mutex_t whitelister_mutex; // protect the |
94 | 347 |
348 void discard(string_set &s); | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
349 const char* register_string(string_set &s, const char *name); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
350 const char* register_string(const char *name); |
164 | 351 void clear_strings(); |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
352 bool load_conf(CONFIG &dc, const char *fn); |
94 | 353 void* verify_closer(void *arg); |
153 | 354 void* whitelister_writer(void *arg); |
94 | 355 void token_init(); |
356 | |
357 #endif |