Mercurial > dnsbl
annotate src/spamass.h @ 195:797299e9fffc stable-6-0-15
fix null dereference if missing _ macro
author | carl |
---|---|
date | Fri, 07 Dec 2007 16:59:41 -0800 |
parents | a4d313c2460b |
children | 82886d4dd71f |
rev | line source |
---|---|
163 | 1 /* |
2 | |
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 | |
6 | |
7 Based on spamass-milter by Georg C. F. Greve <greve@gnu.org> | |
8 | |
9 */ | |
10 | |
177 | 11 #ifndef _SPAMASS_H |
12 #define _SPAMASS_H | |
163 | 13 |
14 extern "C" { | |
15 #include <libmilter/mfapi.h> | |
16 } | |
17 | |
18 #ifdef HAVE_CDEFS_H | |
19 #include <sys/cdefs.h> | |
20 #endif | |
21 | |
22 #include <list> | |
23 | |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
24 extern char *spamc; |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
25 extern char *spamc_empty; |
163 | 26 using namespace std; |
27 | |
28 class mlfiPriv; | |
29 | |
30 class SpamAssassin { | |
31 public: | |
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 SpamAssassin(mlfiPriv *priv_, int ip, char *helo_, char *from, char *qid); |
163 | 33 ~SpamAssassin(); |
34 | |
35 void mlfi_envrcpt(SMFICTX *ctx, char *envrcpt); | |
36 void mlfi_header(char* headerf, char* headerv); | |
37 void mlfi_eoh(); | |
38 void mlfi_body(u_char *bodyp, size_t bodylen); | |
39 int mlfi_eom(); | |
40 | |
41 private: | |
42 void Connect(); | |
43 void output(const char*buffer, size_t size); | |
44 void output(const char*buffer); | |
45 void output(string buffer); | |
46 void close_output(); | |
47 void input(); | |
48 int read_pipe(); | |
49 void empty_and_close_pipe(); | |
50 void closeall(int fd); | |
168 | 51 char *getorwarnmacro(SMFICTX *ctx, char *macro, char *def, char *scope); |
163 | 52 void warnmacro(char *macro, char *scope); |
53 | |
54 public: | |
177 | 55 bool error; // spamc died or cannot work |
56 bool running; // running implies (connected and pid) | |
57 bool first_recipient; // have we not seen any recipients? | |
163 | 58 |
59 // connection back to main dnsbl priv structure for logging | |
60 mlfiPriv *priv; | |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
61 int ip4; // ip4 address of smtp client |
163 | 62 |
63 // strings owned by main dnsbl | |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
64 char *helo; // client helo value |
163 | 65 char *envfrom; // envelope from value for this message |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
163
diff
changeset
|
66 char *queueid; // the sendmail queue id for this message |
163 | 67 |
68 // Process handling variables | |
69 pid_t pid; | |
70 int pipe_io[2][2]; | |
71 string spamc_output; | |
72 string spamc_input; | |
73 }; | |
74 | |
75 #endif |