Mercurial > dnsbl
annotate src/dnsbl.h @ 159:ea7c57a4a2d1 stable-6-01
add auto whitelisting
author | carl |
---|---|
date | Sun, 08 Jul 2007 11:57:51 -0700 |
parents | c7fc218686f5 |
children | 97d7da45fe2a |
rev | line source |
---|---|
143 | 1 /* |
2 | |
152 | 3 Copyright (c) 2007 Carl Byington - 510 Software Group, released under |
4 the GPL version 3 or any later version at your choice available at | |
5 http://www.gnu.org/licenses/gpl-3.0.txt | |
143 | 6 |
7 */ | |
8 | |
119 | 9 #ifndef dnsbl_include |
10 #define dnsbl_include | |
74 | 11 |
12 #include "context.h" | |
13 | |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
14 extern int debug_syslog; |
74 | 15 |
16 class recorder; | |
17 class url_scanner; | |
18 | |
19 //////////////////////////////////////////////// | |
119 | 20 // mail filter private data, held for us by sendmail |
74 | 21 // |
22 struct mlfiPriv | |
23 { | |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
24 // connection specific data |
119 | 25 CONFIG *pc; // global filtering configuration |
26 int fd; // to talk to dns resolvers process | |
27 bool err; // did we get any errors on the resolver socket? | |
28 int ip; // ip4 address of the smtp client | |
29 map<DNSBLP, bool> checked; // map of dnsblp to result of (ip listed on that dnsbl) | |
30 // message specific data | |
31 char *mailaddr; // envelope from value | |
32 char *queueid; // sendmail queue id | |
136 | 33 char *authenticated; // client authenticated? if so, suppress all dnsbl checks, but check rate limits |
119 | 34 bool have_whites; // have at least one whitelisted recipient? need to accept content and remove all non-whitelisted recipients if it fails |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
35 bool only_whites; // every recipient is whitelisted? |
119 | 36 context_map env_to; // map each non-whitelisted recipient to their filtering context |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
37 recorder *memory; // memory for the content scanner |
119 | 38 url_scanner *scanner; // object to handle body scanning |
39 char *content_suffix; // for url body filtering based on ip addresses of hostnames in the body | |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
40 char *content_message; // "" |
119 | 41 char *uribl_suffix; // for uribl body filtering based on hostnames in the body |
42 char *uribl_message; // "" | |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
43 string_set *content_host_ignore; // "" |
76 | 44 |
74 | 45 |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
46 mlfiPriv(); |
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
47 ~mlfiPriv(); |
119 | 48 void reset(bool final = false); // for a new message |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
49 void get_fd(); |
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
50 void return_fd(); |
119 | 51 int my_read(char *buf, int len); |
52 int my_write(char *buf, int len); | |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
53 void need_content_filter(char *rcpt, CONTEXT &con); |
74 | 54 }; |
55 | |
119 | 56 void my_syslog(mlfiPriv *priv, char *text); |
57 void my_syslog(char *text); | |
74 | 58 |
59 #endif |