comparison src/context.h @ 160:b3ed72ee6564

allow manual updates to auto whitelist files
author carl
date Tue, 10 Jul 2007 11:20:23 -0700
parents a220bfb9211f
children c4bce911c276
comparison
equal deleted inserted replaced
159:ea7c57a4a2d1 160:b3ed72ee6564
37 typedef CONTEXT * CONTEXTP; 37 typedef CONTEXT * CONTEXTP;
38 typedef list<CONTEXTP> context_list; 38 typedef list<CONTEXTP> context_list;
39 typedef map<char *, CONTEXTP, ltstr> context_map; 39 typedef map<char *, CONTEXTP, ltstr> context_map;
40 typedef map<char *, int, ltstr> ns_mapper; 40 typedef map<char *, int, ltstr> ns_mapper;
41 typedef map<char *, int, ltstr> rcpt_rates; 41 typedef map<char *, int, ltstr> rcpt_rates;
42 typedef map<char *, int, ltstr> autowhite_sent; 42 typedef map<char *, time_t, ltstr> autowhite_sent;
43 typedef map<char *, VERIFYP, ltstr> verify_map; 43 typedef map<char *, VERIFYP, ltstr> verify_map;
44 typedef map<char *, WHITELISTERP, ltstr> whitelister_map; 44 typedef map<char *, WHITELISTERP, ltstr> whitelister_map;
45 45
46 class SMTP { 46 class SMTP {
47 static const int maxlen = 1000; 47 static const int maxlen = 1000;
93 93
94 class WHITELISTER { 94 class WHITELISTER {
95 char *fn; // file to use 95 char *fn; // file to use
96 int days; // how long do we keep entries 96 int days; // how long do we keep entries
97 pthread_mutex_t mutex; // protect the flag and map 97 pthread_mutex_t mutex; // protect the flag and map
98 time_t loaded; // when we loaded this file
98 bool need; // force writing on new entries 99 bool need; // force writing on new entries
99 autowhite_sent rcpts; // recipient map to remember when we sent them mail 100 autowhite_sent rcpts; // recipient map to remember when we sent them mail
100 public: 101 public:
101 WHITELISTER(char *f, int d); 102 WHITELISTER(char *f, int d);
103 void merge();
102 void writer(); // dump any changes back to the file 104 void writer(); // dump any changes back to the file
103 void sent(char *to); 105 void sent(char *to);
104 bool is_white(char *from); // should we white list this sender (did we send them anything recently) 106 bool is_white(char *from); // should we white list this sender (did we send them anything recently)
105 int get_days() {return days;}; 107 int get_days() {return days;};
106 void set_days(int d) {days = d;}; 108 void set_days(int d) {days = d;};