74
|
1 #ifndef dnsbl_include
|
|
2 #define dnsbl_include
|
|
3
|
|
4 #include "context.h"
|
|
5
|
|
6 extern bool debug_syslog;
|
|
7
|
|
8 class recorder;
|
|
9 class url_scanner;
|
|
10
|
|
11 ////////////////////////////////////////////////
|
|
12 // mail filter private data, held for us by sendmail
|
|
13 //
|
|
14 struct mlfiPriv
|
|
15 {
|
|
16 // connection specific data
|
|
17 CONFIG *pc; // global filtering configuration
|
|
18 int fd; // to talk to dns resolvers process
|
|
19 bool err; // did we get any errors on the resolver socket?
|
|
20 int ip; // ip4 address of the smtp client
|
|
21 map<DNSBLP, bool> checked; // map of dnsblp to result of (ip listed on that dnsbl)
|
|
22 // message specific data
|
|
23 char *mailaddr; // envelope from value
|
|
24 char *queueid; // sendmail queue id
|
|
25 bool authenticated; // client authenticated? if so, suppress all dnsbl checks
|
|
26 bool have_whites; // have at least one whitelisted recipient? need to accept content and remove all non-whitelisted recipients if it fails
|
|
27 bool only_whites; // every recipient is whitelisted?
|
|
28 context_map env_to; // map each non-whitelisted recipient to their filtering context
|
|
29 recorder *memory; // memory for the content scanner
|
|
30 url_scanner *scanner; // object to handle body scanning
|
76
|
31 char *content_suffix; // content filtering parameters
|
|
32 char *content_message; // ""
|
|
33 string_set *content_host_ignore; // ""
|
|
34
|
74
|
35
|
|
36 mlfiPriv();
|
|
37 ~mlfiPriv();
|
|
38 void reset(bool final = false); // for a new message
|
|
39 void get_fd();
|
|
40 void return_fd();
|
|
41 int my_read(char *buf, int len);
|
|
42 int my_write(char *buf, int len);
|
|
43 void need_content_filter(char *rcpt, CONTEXT &con);
|
|
44 };
|
|
45
|
|
46 void my_syslog(mlfiPriv *priv, char *text);
|
|
47 void my_syslog(char *text);
|
|
48
|
|
49 #endif
|