Mercurial > dnsbl
comparison src/context.h @ 233:5c3e9bf45bb5 stable-6-0-23
Add whitelisting by regex expression filtering.
Add queueid to whitelist extension log message.
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Mon, 25 May 2009 11:14:32 -0700 |
parents | 82886d4dd71f |
children | d8ee4c97b9ab |
comparison
equal
deleted
inserted
replaced
232:768ce0f23149 | 233:5c3e9bf45bb5 |
---|---|
133 const char * verify_host; // use this smtp host to verify email addresses | 133 const char * verify_host; // use this smtp host to verify email addresses |
134 VERIFYP verifier; // pointer to the verifier structure | 134 VERIFYP verifier; // pointer to the verifier structure |
135 const char * generic_regx; // pointer to generic regular expression | 135 const char * generic_regx; // pointer to generic regular expression |
136 const char * generic_message; // pointer to generic message with one %s | 136 const char * generic_message; // pointer to generic message with one %s |
137 regex_t generic_pattern; // compiled regex pattern | 137 regex_t generic_pattern; // compiled regex pattern |
138 const char * white_regx; // pointer to whitelist regular expression | |
139 regex_t white_pattern; // compiled regex pattern | |
138 const char * autowhite_file; // file to use for automatic whitelisting | 140 const char * autowhite_file; // file to use for automatic whitelisting |
139 WHITELISTERP whitelister; // pointer to the auto whitelister structure | 141 WHITELISTERP whitelister; // pointer to the auto whitelister structure |
140 string_map env_from; // map senders to white/black/unknown | 142 string_map env_from; // map senders to white/black/unknown |
141 context_map env_from_context; // map senders to a child context | 143 context_map env_from_context; // map senders to a child context |
142 const char * env_from_default; // default value for senders that are not found in the map white/black/unknown/inherit | 144 const char * env_from_default; // default value for senders that are not found in the map white/black/unknown/inherit |
191 | 193 |
192 void add_to(const char *to) {env_to.insert(to);}; | 194 void add_to(const char *to) {env_to.insert(to);}; |
193 void add_from(const char *from, const char *status) {env_from[from] = status;}; | 195 void add_from(const char *from, const char *status) {env_from[from] = status;}; |
194 void add_from_context(const char *from, CONTEXTP con) {env_from_context[from] = con;}; | 196 void add_from_context(const char *from, CONTEXTP con) {env_from_context[from] = con;}; |
195 void set_from_default(const char *status) {env_from_default = status;}; | 197 void set_from_default(const char *status) {env_from_default = status;}; |
196 const char* find_from(const char *from, bool update_white = false); | 198 const char* find_from(const char *from, bool update_white = false, const char *queueid = NULL); |
197 CONTEXTP find_context(const char *from); | 199 CONTEXTP find_context(const char *from); |
198 CONTEXTP find_from_context_name(const char *name); | 200 CONTEXTP find_from_context_name(const char *name); |
199 | 201 |
200 void set_content_filtering(bool filter) {content_filtering = filter; }; | 202 void set_content_filtering(bool filter) {content_filtering = filter; }; |
201 void set_content_suffix(const char *suffix) {content_suffix = suffix; }; | 203 void set_content_suffix(const char *suffix) {content_suffix = suffix; }; |
215 void add_tag(const char *tag) {html_tags.insert(tag); }; | 217 void add_tag(const char *tag) {html_tags.insert(tag); }; |
216 | 218 |
217 void add_dnsbl(const char *name, DNSBLP dns) {dnsbl_names[name] = dns; }; | 219 void add_dnsbl(const char *name, DNSBLP dns) {dnsbl_names[name] = dns; }; |
218 void add_dnsbl(DNSBLP dns) {dnsbl_list.push_back(dns);}; | 220 void add_dnsbl(DNSBLP dns) {dnsbl_list.push_back(dns);}; |
219 DNSBLP find_dnsbl(const char *name); | 221 DNSBLP find_dnsbl(const char *name); |
222 | |
223 bool set_white(const char *regx); | |
224 bool white_match(const char *from); | |
220 | 225 |
221 bool set_generic(const char *regx, const char *msg); | 226 bool set_generic(const char *regx, const char *msg); |
222 const char* generic_match(const char *client); | 227 const char* generic_match(const char *client); |
223 | 228 |
224 void set_require(bool r) {require_match = r; }; | 229 void set_require(bool r) {require_match = r; }; |
310 extern const char *token_tld; | 315 extern const char *token_tld; |
311 extern const char *token_unknown; | 316 extern const char *token_unknown; |
312 extern const char *token_uribl; | 317 extern const char *token_uribl; |
313 extern const char *token_verify; | 318 extern const char *token_verify; |
314 extern const char *token_white; | 319 extern const char *token_white; |
320 extern const char *token_white_regex; | |
315 extern const char *token_yes; | 321 extern const char *token_yes; |
316 | 322 |
317 extern pthread_mutex_t verifier_mutex; // protect the verifier map | 323 extern pthread_mutex_t verifier_mutex; // protect the verifier map |
318 extern pthread_mutex_t whitelister_mutex; // protect the | 324 extern pthread_mutex_t whitelister_mutex; // protect the |
319 | 325 |