annotate src/dnsbl.h @ 124:ea6f9c812faa stable-5-16

put hostname in smtp message for uribl style lookups
author carl
date Thu, 16 Mar 2006 15:20:37 -0800
parents d9d2f8699621
children f4746d8a12a3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
1 #ifndef dnsbl_include
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
2 #define dnsbl_include
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
3
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
4 #include "context.h"
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
5
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
6 extern int debug_syslog;
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
7
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
8 class recorder;
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
9 class url_scanner;
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
10
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
11 ////////////////////////////////////////////////
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
12 // mail filter private data, held for us by sendmail
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
13 //
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
14 struct mlfiPriv
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
15 {
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
16 // connection specific data
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
17 CONFIG *pc; // global filtering configuration
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
18 int fd; // to talk to dns resolvers process
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
19 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
20 int ip; // ip4 address of the smtp client
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
21 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
22 // message specific data
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
23 char *mailaddr; // envelope from value
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
24 char *queueid; // sendmail queue id
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
25 bool authenticated; // client authenticated? if so, suppress all dnsbl checks
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
26 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
27 bool only_whites; // every recipient is whitelisted?
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
28 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
29 recorder *memory; // memory for the content scanner
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
30 url_scanner *scanner; // object to handle body scanning
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
31 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
32 char *content_message; // ""
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
33 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
34 char *uribl_message; // ""
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
35 string_set *content_host_ignore; // ""
76
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
36
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
37
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
38 mlfiPriv();
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
39 ~mlfiPriv();
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
40 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
41 void get_fd();
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
42 void return_fd();
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
43 int my_read(char *buf, int len);
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
44 int my_write(char *buf, int len);
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
45 void need_content_filter(char *rcpt, CONTEXT &con);
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
46 };
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
47
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
48 void my_syslog(mlfiPriv *priv, char *text);
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
49 void my_syslog(char *text);
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
50
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
51 #endif