annotate src/dnsbl.h @ 163:97d7da45fe2a

spamassassin changes
author carl
date Sun, 26 Aug 2007 19:03:17 -0700
parents c7fc218686f5
children 9b129ed78d7d
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
152
c7fc218686f5 gpl3, block mail to recipients that cannot reply
carl
parents: 143
diff changeset
3 Copyright (c) 2007 Carl Byington - 510 Software Group, released under
c7fc218686f5 gpl3, block mail to recipients that cannot reply
carl
parents: 143
diff changeset
4 the GPL version 3 or any later version at your choice available at
c7fc218686f5 gpl3, block mail to recipients that cannot reply
carl
parents: 143
diff changeset
5 http://www.gnu.org/licenses/gpl-3.0.txt
143
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"
163
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
13 #include "spamass.h"
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
14
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
15 extern int debug_syslog;
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
16
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
17 class recorder;
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
18 class url_scanner;
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
19
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
20 ////////////////////////////////////////////////
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
21 // mail filter private data, held for us by sendmail
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
22 //
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
23 struct mlfiPriv
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
24 {
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
25 // connection specific data
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
26 CONFIG *pc; // global filtering configuration
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
27 int fd; // to talk to dns resolvers process
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
28 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
29 int ip; // ip4 address of the smtp client
163
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
30 char *helo; // helo from client
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
31 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
32 // message specific data
163
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
33 char *mailaddr; // envelope from value
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
34 char *queueid; // sendmail queue id
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
35 char *authenticated; // client authenticated? if so, suppress all dnsbl checks, but check rate limits
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
36 bool have_whites; // have at least one whitelisted recipient? need to accept content and remove all non-whitelisted recipients if it fails
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
37 bool only_whites; // every recipient is whitelisted?
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
38 context_map env_to; // map each non-whitelisted recipient to their filtering context
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
39 recorder *memory; // memory for the content scanner
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
40 url_scanner *scanner; // object to handle body scanning
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
41 char *content_suffix; // for url body filtering based on ip addresses of hostnames in the body
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
42 char *content_message; // ""
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
43 char *uribl_suffix; // for uribl body filtering based on hostnames in the body
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
44 char *uribl_message; // ""
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
45 string_set *content_host_ignore; // ""
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
46 SpamAssassin *assassin;
76
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
47
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
48
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
49 mlfiPriv();
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
50 ~mlfiPriv();
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
51 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
52 void get_fd();
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
53 void return_fd();
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
54 int my_read(char *buf, int len);
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
55 int my_write(char *buf, int len);
86
c1280cd3e248 add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents: 76
diff changeset
56 void need_content_filter(char *rcpt, CONTEXT &con);
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
57 };
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
58
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
59 void my_syslog(mlfiPriv *priv, char *text);
163
97d7da45fe2a spamassassin changes
carl
parents: 152
diff changeset
60 void my_syslog(mlfiPriv *priv, string text);
119
d9d2f8699621 uribl patch from Jeff Evans <jeffe@tricab.com>
carl
parents: 86
diff changeset
61 void my_syslog(char *text);
74
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
62
b7449114ebb0 start coding on new config syntax
carl
parents:
diff changeset
63 #endif