Mercurial > dnsbl
annotate src/dnsbl.h @ 167:9b129ed78d7d stable-6-0-6
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
author | carl |
---|---|
date | Mon, 27 Aug 2007 20:49:19 -0700 |
parents | 97d7da45fe2a |
children | 6bac960af6b4 |
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" | |
163 | 13 #include "spamass.h" |
74 | 14 |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
15 extern int debug_syslog; |
74 | 16 |
17 class recorder; | |
18 class url_scanner; | |
19 | |
20 //////////////////////////////////////////////// | |
119 | 21 // mail filter private data, held for us by sendmail |
74 | 22 // |
23 struct mlfiPriv | |
24 { | |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
25 // connection specific data |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
26 CONFIG *pc; // global filtering configuration |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
27 int fd; // to talk to dns resolvers process |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
28 bool err; // did we get any errors on the resolver socket? |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
29 int ip; // ip4 address of the smtp client |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
30 char *helo; // helo from client |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
31 map<DNSBLP, bool> checked; // map of dnsblp to result of (ip listed on that dnsbl) |
119 | 32 // message specific data |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
33 char *mailaddr; // envelope from value |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
34 char *queueid; // sendmail queue id |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
35 char *authenticated; // client authenticated? if so, suppress all dnsbl checks, but check rate limits |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
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 |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
37 bool only_whites; // every recipient is whitelisted? |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
38 bool want_spamassassin; // at least one non-whitelisted recipients has a non zero spamassassin limit |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
39 context_map env_to; // map each non-whitelisted recipient to their filtering context |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
40 recorder *memory; // memory for the content scanner |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
41 url_scanner *scanner; // object to handle body scanning |
163 | 42 char *content_suffix; // for url body filtering based on ip addresses of hostnames in the body |
43 char *content_message; // "" | |
44 char *uribl_suffix; // for uribl body filtering based on hostnames in the body | |
45 char *uribl_message; // "" | |
46 string_set *content_host_ignore; // "" | |
47 SpamAssassin *assassin; | |
76 | 48 |
74 | 49 |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
50 mlfiPriv(); |
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
51 ~mlfiPriv(); |
119 | 52 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
|
53 void get_fd(); |
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
54 void return_fd(); |
119 | 55 int my_read(char *buf, int len); |
56 int my_write(char *buf, int len); | |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
57 void need_content_filter(char *rcpt, CONTEXT &con); |
74 | 58 }; |
59 | |
119 | 60 void my_syslog(mlfiPriv *priv, char *text); |
163 | 61 void my_syslog(mlfiPriv *priv, string text); |
119 | 62 void my_syslog(char *text); |
74 | 63 |
64 #endif |