annotate src/dnsbl.h @ 143:ecb40aa3eaa5 stable-5-23

require two periods for ip addresses
author carl
date Tue, 10 Oct 2006 19:12:16 -0700
parents f4746d8a12a3
children c7fc218686f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
143
ecb40aa3eaa5 require two periods for ip addresses
carl
parents: 136
diff changeset
1 /*
ecb40aa3eaa5 require two periods for ip addresses
carl
parents: 136
diff changeset
2
ecb40aa3eaa5 require two periods for ip addresses
carl
parents: 136
diff changeset
3 Copyright (c) 2006 Carl Byington - 510 Software Group, released under
ecb40aa3eaa5 require two periods for ip addresses
carl
parents: 136
diff changeset
4 the GPL version 2 or any later version at your choice available at
ecb40aa3eaa5 require two periods for ip addresses
carl
parents: 136
diff changeset
5 http://www.fsf.org/licenses/gpl.txt
ecb40aa3eaa5 require two periods for ip addresses
carl
parents: 136
diff changeset
6
ecb40aa3eaa5 require two periods for ip addresses
carl
parents: 136
diff changeset
7 */
ecb40aa3eaa5 require two periods for ip addresses
carl
parents: 136
diff changeset
8
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
9 #ifndef dnsbl_include
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
10 #define dnsbl_include
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
11
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
12 #include "context.h"
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
13
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
14 extern int debug_syslog;
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
15
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
16 class recorder;
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
17 class url_scanner;
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
18
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
19 ////////////////////////////////////////////////
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
20 // mail filter private data, held for us by sendmail
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
21 //
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
22 struct mlfiPriv
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
23 {
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
24 // connection specific data
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
25 CONFIG *pc; // global filtering configuration
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
26 int fd; // to talk to dns resolvers process
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
27 bool err; // did we get any errors on the resolver socket?
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
28 int ip; // ip4 address of the smtp client
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
29 map<DNSBLP, bool> checked; // map of dnsblp to result of (ip listed on that dnsbl)
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
30 // message specific data
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
31 char *mailaddr; // envelope from value
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
32 char *queueid; // sendmail queue id
136
f4746d8a12a3 add smtp auth rate limits
carl
parents: 119
diff changeset
33 char *authenticated; // client authenticated? if so, suppress all dnsbl checks, but check rate limits
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
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
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
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
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
38 url_scanner *scanner; // object to handle body scanning
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
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
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
41 char *uribl_suffix; // for uribl body filtering based on hostnames in the body
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
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
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
44
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
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
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
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
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
51 int my_read(char *buf, int len);
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
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
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
54 };
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
55
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
56 void my_syslog(mlfiPriv *priv, char *text);
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
57 void my_syslog(char *text);
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
58
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
59 #endif