Mercurial > dnsbl
annotate src/dnsbl.h @ 242:d8ee4c97b9ab stable-6-0-26
64 bit fixes for libresolv.a
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Fri, 19 Nov 2010 13:01:07 -0800 |
parents | 7b818a4e21a4 |
children | 15bf4f68a0b2 |
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 |
190
004b855c6c1f
fix null pointer dereference from missing HELO command
carl
parents:
187
diff
changeset
|
29 bool eom; // are we in eom function, so progress function can be called? |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
30 // connection specific data |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
31 CONFIG *pc; // global filtering configuration |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
32 int fd; // to talk to dns resolver process |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
33 bool err; // did we get any errors on the resolver socket? |
242
d8ee4c97b9ab
64 bit fixes for libresolv.a
Carl Byington <carl@five-ten-sg.com>
parents:
238
diff
changeset
|
34 int32_t ip; // ip4 address of the smtp client |
236
c0d2e99c0a1d
Add surbl checks on the smtp helo value, client reverse dns name, and mail from domain name
Carl Byington <carl@five-ten-sg.com>
parents:
230
diff
changeset
|
35 const char *helo; // helo from client |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
36 map<DNSBLP, bool> checked; // map of dnsblp to result of (ip listed on that dnsbl) |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
37 // message specific data |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
38 const char *mailaddr; // envelope from value |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
39 const char *queueid; // sendmail queue id |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
40 const char *authenticated; // client authenticated? if so, suppress all dnsbl checks, but check rate limits |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
41 const char *client_name; // fully qualified host name of the smtp client |
238
7b818a4e21a4
produce correct uribl message
Carl Byington <carl@five-ten-sg.com>
parents:
236
diff
changeset
|
42 const char *host_uribl; // pointer to helo/client/from host name if found on uribl |
7b818a4e21a4
produce correct uribl message
Carl Byington <carl@five-ten-sg.com>
parents:
236
diff
changeset
|
43 string_set hosts_uribl; // string set to hold the helo/client/from host name if found on uribl |
236
c0d2e99c0a1d
Add surbl checks on the smtp helo value, client reverse dns name, and mail from domain name
Carl Byington <carl@five-ten-sg.com>
parents:
230
diff
changeset
|
44 bool helo_uribl; // helo value on uribl |
c0d2e99c0a1d
Add surbl checks on the smtp helo value, client reverse dns name, and mail from domain name
Carl Byington <carl@five-ten-sg.com>
parents:
230
diff
changeset
|
45 bool client_uribl; // client_name on uribl |
c0d2e99c0a1d
Add surbl checks on the smtp helo value, client reverse dns name, and mail from domain name
Carl Byington <carl@five-ten-sg.com>
parents:
230
diff
changeset
|
46 bool from_uribl; // envelope from value on uribl |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
47 bool have_whites; // have at least one whitelisted recipient? need to accept content and remove all non-whitelisted recipients if it fails |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
48 bool only_whites; // every recipient is whitelisted? |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
49 bool want_spamassassin; // at least one non-whitelisted recipient has a non zero spamassassin limit |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
50 bool want_dccgrey; // at least one non-whitelisted recipient wants dcc greylisting |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
51 bool want_dccbulk; // at least one non-whitelisted recipient wants dcc bulk filtering |
230
ad38575e98ca
Prevent auto whitelisting due to outgoing multipart/report delivery notifications.
Carl Byington <carl@five-ten-sg.com>
parents:
214
diff
changeset
|
52 bool allow_autowhitelisting; // precedence:bulk or content-type:multipart/report headers prevent autowhitelisting |
192
8f4a9a37d4d9
delay autowhitelisting to avoid out of office reply bots
carl
parents:
190
diff
changeset
|
53 delay_whitelist delayer; // to remember autowhitelisting until we see headers |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
54 CONTEXT *content_context; // first non-whitelisted recipient with a content filtering context |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
55 context_map env_to; // map each non-whitelisted recipient to their filtering context |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
56 recorder *memory; // memory for the content scanner |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
57 url_scanner *scanner; // object to handle body scanning |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
58 const char *content_suffix; // for url body filtering based on ip addresses of hostnames in the body |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
59 const char *content_message; // "" |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
60 const char *uribl_suffix; // for uribl body filtering based on hostnames in the body |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
61 const char *uribl_message; // "" |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
62 string_set *content_host_ignore; // "" |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
63 SpamAssassin *assassin; |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
64 DccInterface *dccifd; |
76 | 65 |
74 | 66 |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
67 mlfiPriv(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
68 ~mlfiPriv(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
69 void reset(bool final = false); // for a new message |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
70 void get_fd(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
71 void return_fd(); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
72 size_t my_read(char *buf, size_t len); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
73 size_t my_write(const char *buf, size_t len); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
74 void need_content_filter(const char *rcpt, CONTEXT &con); |
74 | 75 }; |
76 | |
214
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
77 void my_syslog(mlfiPriv *priv, const char *text); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
78 void my_syslog(mlfiPriv *priv, const string text); |
82886d4dd71f
Fixes to compile on Fedora 9 and for const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
192
diff
changeset
|
79 void my_syslog(const char *text); |
74 | 80 |
81 #endif |