comparison src/context.h @ 168:6bac960af6b4

add generic reverse dns filtering regex
author carl
date Thu, 30 Aug 2007 11:08:46 -0700
parents 9b129ed78d7d
children bd33eaccfed8
comparison
equal deleted inserted replaced
167:9b129ed78d7d 168:6bac960af6b4
9 #ifndef context_include 9 #ifndef context_include
10 #define context_include 10 #define context_include
11 11
12 #include "tokenizer.h" 12 #include "tokenizer.h"
13 #include <map> 13 #include <map>
14 #include <regex.h>
14 15
15 16
16 enum status {oksofar, // not rejected yet 17 enum status {oksofar, // not rejected yet
17 white, // whitelisted 18 white, // whitelisted
18 black, // blacklisted 19 black, // blacklisted
121 char * name; 122 char * name;
122 context_map children; // map child context names to their contexts 123 context_map children; // map child context names to their contexts
123 string_set env_to; // this context applies to these envelope recipients 124 string_set env_to; // this context applies to these envelope recipients
124 char * verify_host; // use this smtp host to verify email addresses 125 char * verify_host; // use this smtp host to verify email addresses
125 VERIFYP verifier; // pointer to the verifier structure 126 VERIFYP verifier; // pointer to the verifier structure
127 char * generic_regx; // pointer to generic regular expression
128 char * generic_message; // pointer to generic message with one %s
129 regex_t generic_pattern; // compiled regular expression
126 char * autowhite_file; // file to use for automatic whitelisting 130 char * autowhite_file; // file to use for automatic whitelisting
127 WHITELISTERP whitelister; // pointer to the auto whitelister structure 131 WHITELISTERP whitelister; // pointer to the auto whitelister structure
128 string_map env_from; // map senders to white/black/unknown 132 string_map env_from; // map senders to white/black/unknown
129 context_map env_from_context; // map senders to a child context 133 context_map env_from_context; // map senders to a child context
130 char * env_from_default; // default value for senders that are not found in the map white/black/unknown/inherit 134 char * env_from_default; // default value for senders that are not found in the map white/black/unknown/inherit
162 void set_verifier(VERIFYP v) {verifier = v;}; 166 void set_verifier(VERIFYP v) {verifier = v;};
163 void set_verify(char *host) {verify_host = host;}; 167 void set_verify(char *host) {verify_host = host;};
164 char* get_verify() {return verify_host;}; 168 char* get_verify() {return verify_host;};
165 VERIFYP find_verify(char *to); 169 VERIFYP find_verify(char *to);
166 170
171
167 void set_whitelister(WHITELISTERP v) {whitelister = v;}; 172 void set_whitelister(WHITELISTERP v) {whitelister = v;};
168 void set_autowhite(char *fn) {autowhite_file = fn;}; 173 void set_autowhite(char *fn) {autowhite_file = fn;};
169 char* get_autowhite() {return autowhite_file;}; 174 char* get_autowhite() {return autowhite_file;};
170 WHITELISTERP find_autowhite(char *from, char *to); 175 WHITELISTERP find_autowhite(char *from, char *to);
171 176
199 void add_tag(char *tag) {html_tags.insert(tag); }; 204 void add_tag(char *tag) {html_tags.insert(tag); };
200 205
201 void add_dnsbl(char *name, DNSBLP dns) {dnsbl_names[name] = dns; }; 206 void add_dnsbl(char *name, DNSBLP dns) {dnsbl_names[name] = dns; };
202 void add_dnsbl(DNSBLP dns) {dnsbl_list.push_back(dns);}; 207 void add_dnsbl(DNSBLP dns) {dnsbl_list.push_back(dns);};
203 DNSBLP find_dnsbl(char *name); 208 DNSBLP find_dnsbl(char *name);
209
210 bool set_generic(char *regx, char *msg);
211 char* generic_match(char *client);
204 212
205 bool get_content_filtering() {return content_filtering; }; 213 bool get_content_filtering() {return content_filtering; };
206 int get_host_limit() {return host_limit; }; 214 int get_host_limit() {return host_limit; };
207 bool get_host_random() {return host_random; }; 215 bool get_host_random() {return host_random; };
208 int get_spamassassin_limit() {return (content_filtering) ? spamassassin_limit : 0;}; 216 int get_spamassassin_limit() {return (content_filtering) ? spamassassin_limit : 0;};
258 extern char *token_dnsbl; 266 extern char *token_dnsbl;
259 extern char *token_dnsbll; 267 extern char *token_dnsbll;
260 extern char *token_envfrom; 268 extern char *token_envfrom;
261 extern char *token_envto; 269 extern char *token_envto;
262 extern char *token_filter; 270 extern char *token_filter;
271 extern char *token_generic;
263 extern char *token_host_limit; 272 extern char *token_host_limit;
264 extern char *token_html_limit; 273 extern char *token_html_limit;
265 extern char *token_html_tags; 274 extern char *token_html_tags;
266 extern char *token_ignore; 275 extern char *token_ignore;
267 extern char *token_include; 276 extern char *token_include;