comparison src/context.h @ 255:d6d5c50b9278 stable-6-0-30

Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
author Carl Byington <carl@five-ten-sg.com>
date Mon, 09 Apr 2012 18:02:05 -0700
parents 15bf4f68a0b2
children be939802c64e
comparison
equal deleted inserted replaced
254:720cdc2c303f 255:d6d5c50b9278
173 bool require_match; // require matching context filtering context 173 bool require_match; // require matching context filtering context
174 bool dcc_greylist; // should we do dcc greylisting? 174 bool dcc_greylist; // should we do dcc greylisting?
175 int dcc_bulk_threshold; // off = 0, many = 1000 175 int dcc_bulk_threshold; // off = 0, many = 1000
176 dnsblp_map dnsbl_names; // name to dnsbl mapping for lists that are available in this context and children 176 dnsblp_map dnsbl_names; // name to dnsbl mapping for lists that are available in this context and children
177 dnsblp_list dnsbl_list; // list of dnsbls to be used in this context 177 dnsblp_list dnsbl_list; // list of dnsbls to be used in this context
178 bool dnsbl_list_parsed; // true iff we have actually parsed a dnsbl_list
178 dnswlp_map dnswl_names; // name to dnswl mapping for lists that are available in this context and children 179 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 180 dnswlp_list dnswl_list; // list of dnswls to be used in this context
181 bool dnswl_list_parsed; // true iff we have actually parsed a dnswl_list
180 int default_rcpt_rate; // if not specified per user 182 int default_rcpt_rate; // if not specified per user
183 int rcpt_daily_multiple;// daily multiplier applied to hourly rate
181 rcpt_rates rcpt_per_hour; // per user limits on number of recipients per hour 184 rcpt_rates rcpt_per_hour; // per user limits on number of recipients per hour
182 185
183 186
184 public: 187 public:
185 CONTEXT(CONTEXTP parent_, const char *name_); 188 CONTEXT(CONTEXTP parent_, const char *name_);
201 void set_autowhite(const char *fn) {autowhite_file = fn;}; 204 void set_autowhite(const char *fn) {autowhite_file = fn;};
202 const char* get_autowhite() {return autowhite_file;}; 205 const char* get_autowhite() {return autowhite_file;};
203 WHITELISTERP find_autowhite(const char *from, const char *to); 206 WHITELISTERP find_autowhite(const char *from, const char *to);
204 207
205 void set_default_rate(int limit) {default_rcpt_rate = limit;}; 208 void set_default_rate(int limit) {default_rcpt_rate = limit;};
209 void set_daily_multiple(int multiple) {rcpt_daily_multiple = multiple;};
206 void add_rate(const char *user, int limit) {rcpt_per_hour[user] = limit;}; 210 void add_rate(const char *user, int limit) {rcpt_per_hour[user] = limit;};
207 int find_rate(const char *user); 211 int find_rate(const char *user);
212 int get_daily_multiple() {return rcpt_daily_multiple;};
208 213
209 void add_to(const char *to) {env_to.insert(to);}; 214 void add_to(const char *to) {env_to.insert(to);};
210 void add_from(const char *from, const char *status) {env_from[from] = status;}; 215 void add_from(const char *from, const char *status) {env_from[from] = status;};
211 void add_from_context(const char *from, CONTEXTP con) {env_from_context[from] = con;}; 216 void add_from_context(const char *from, CONTEXTP con) {env_from_context[from] = con;};
212 void set_from_default(const char *status) {env_from_default = status;}; 217 void set_from_default(const char *status) {env_from_default = status;};
232 void add_tag(const char *tag) {html_tags.insert(tag); }; 237 void add_tag(const char *tag) {html_tags.insert(tag); };
233 238
234 void add_dnsbl(const char *name, DNSBLP dns) {dnsbl_names[name] = dns; }; 239 void add_dnsbl(const char *name, DNSBLP dns) {dnsbl_names[name] = dns; };
235 void add_dnsbl(DNSBLP dns) {dnsbl_list.push_back(dns);}; 240 void add_dnsbl(DNSBLP dns) {dnsbl_list.push_back(dns);};
236 DNSBLP find_dnsbl(const char *name); 241 DNSBLP find_dnsbl(const char *name);
242 void set_dnsbll_parsed() {dnsbl_list_parsed = true;};
237 243
238 void add_dnswl(const char *name, DNSWLP dns) {dnswl_names[name] = dns; }; 244 void add_dnswl(const char *name, DNSWLP dns) {dnswl_names[name] = dns; };
239 void add_dnswl(DNSWLP dns) {dnswl_list.push_back(dns);}; 245 void add_dnswl(DNSWLP dns) {dnswl_list.push_back(dns);};
240 DNSWLP find_dnswl(const char *name); 246 DNSWLP find_dnswl(const char *name);
247 void set_dnswll_parsed() {dnswl_list_parsed = true;};
241 248
242 bool set_white(const char *regx); 249 bool set_white(const char *regx);
243 bool white_match(const char *from); 250 bool white_match(const char *from);
244 251
245 bool set_generic(const char *regx, const char *msg); 252 bool set_generic(const char *regx, const char *msg);