comparison src/context.h @ 140:4028de9b46dd

cleanup smtp rate limit code
author carl
date Wed, 27 Sep 2006 08:00:13 -0700
parents f4746d8a12a3
children ecb40aa3eaa5
comparison
equal deleted inserted replaced
139:003026deaed1 140:4028de9b46dd
110 bool host_random; // pick a random selection of host names rather than error for excessive hosts 110 bool host_random; // pick a random selection of host names rather than error for excessive hosts
111 int tag_limit; // limit on bad html tags 111 int tag_limit; // limit on bad html tags
112 char * tag_limit_message; // error message for excessive bad html tags 112 char * tag_limit_message; // error message for excessive bad html tags
113 dnsblp_map dnsbl_names; // name to dnsbl mapping for lists that are available in this context and children 113 dnsblp_map dnsbl_names; // name to dnsbl mapping for lists that are available in this context and children
114 dnsblp_list dnsbl_list; // list of dnsbls to be used in this context 114 dnsblp_list dnsbl_list; // list of dnsbls to be used in this context
115 int default_rcpt_rate; // if not specified per user
115 rcpt_rates rcpt_per_hour; // per user limits on number of recipients per hour 116 rcpt_rates rcpt_per_hour; // per user limits on number of recipients per hour
116 117
117 118
118 public: 119 public:
119 CONTEXT(CONTEXTP parent_, char *name_); 120 CONTEXT(CONTEXTP parent_, char *name_);
127 128
128 void set_verify(char *host) {verify_host = host;}; 129 void set_verify(char *host) {verify_host = host;};
129 char* get_verify() {return verify_host;}; 130 char* get_verify() {return verify_host;};
130 VERIFYP find_verify(char *to); 131 VERIFYP find_verify(char *to);
131 132
133 void set_default_rate(int limit) {default_rcpt_rate = limit;};
132 void add_rate(char *user, int limit) {rcpt_per_hour[user] = limit;}; 134 void add_rate(char *user, int limit) {rcpt_per_hour[user] = limit;};
133 int find_rate(char *user); 135 int find_rate(char *user);
134 136
135 void add_to(char *to) {env_to.insert(to);}; 137 void add_to(char *to) {env_to.insert(to);};
136 void add_from(char *from, char *status) {env_from[from] = status;}; 138 void add_from(char *from, char *status) {env_from[from] = status;};