Mercurial > dnsbl
annotate src/dnsbl.h @ 188:edcefdb7ccc1
fix null pointer dereference from missing HELO command
author | carl |
---|---|
date | Sat, 10 Nov 2007 10:27:05 -0800 |
parents | f0eda59e8afd |
children | 004b855c6c1f |
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" |
178 | 14 #include "dccifd.h" |
74 | 15 |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
16 extern int debug_syslog; |
180 | 17 #define dccbulk 1000 |
74 | 18 |
19 class recorder; | |
20 class url_scanner; | |
21 | |
22 //////////////////////////////////////////////// | |
119 | 23 // mail filter private data, held for us by sendmail |
74 | 24 // |
25 struct mlfiPriv | |
26 { | |
187
f0eda59e8afd
fix null pointer dereference from missing HELO command
carl
parents:
180
diff
changeset
|
27 // callback specific data |
f0eda59e8afd
fix null pointer dereference from missing HELO command
carl
parents:
180
diff
changeset
|
28 SMFICTX *ctx; // updated everytime we fetch this priv pointer from the ctx |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
29 // 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
|
30 CONFIG *pc; // global filtering configuration |
177 | 31 int fd; // to talk to dns resolver process |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
32 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
|
33 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
|
34 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
|
35 map<DNSBLP, bool> checked; // map of dnsblp to result of (ip listed on that dnsbl) |
119 | 36 // 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
|
37 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
|
38 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
|
39 char *authenticated; // client authenticated? if so, suppress all dnsbl checks, but check rate limits |
168 | 40 char *client_name; // fully qualified host name of the smtp client |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
41 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
|
42 bool only_whites; // every recipient is whitelisted? |
178 | 43 bool want_spamassassin; // at least one non-whitelisted recipient has a non zero spamassassin limit |
44 bool want_dccgrey; // at least one non-whitelisted recipient wants dcc greylisting | |
45 bool want_dccbulk; // at least one non-whitelisted recipient wants dcc bulk filtering | |
46 CONTEXT *content_context; // first non-whitelisted recipient with a content filtering context | |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
47 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
|
48 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
|
49 url_scanner *scanner; // object to handle body scanning |
163 | 50 char *content_suffix; // for url body filtering based on ip addresses of hostnames in the body |
51 char *content_message; // "" | |
52 char *uribl_suffix; // for uribl body filtering based on hostnames in the body | |
53 char *uribl_message; // "" | |
54 string_set *content_host_ignore; // "" | |
55 SpamAssassin *assassin; | |
178 | 56 DccInterface *dccifd; |
76 | 57 |
74 | 58 |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
59 mlfiPriv(); |
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
60 ~mlfiPriv(); |
119 | 61 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
|
62 void get_fd(); |
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
63 void return_fd(); |
177 | 64 size_t my_read(char *buf, size_t len); |
65 size_t my_write(const char *buf, size_t len); | |
86
c1280cd3e248
add multiple debug syslog levels, remove duplicate dnsbl definitions
carl
parents:
76
diff
changeset
|
66 void need_content_filter(char *rcpt, CONTEXT &con); |
74 | 67 }; |
68 | |
119 | 69 void my_syslog(mlfiPriv *priv, char *text); |
163 | 70 void my_syslog(mlfiPriv *priv, string text); |
119 | 71 void my_syslog(char *text); |
74 | 72 |
73 #endif |