ze-filter  (ze-filter-0.8.0-develop-180218)
ze-oracle-scores.h
Go to the documentation of this file.
1 /*
2  *
3  * ze-filter - Mail Server Filter for sendmail
4  *
5  * Copyright (c) 2001-2018 - Jose-Marcio Martins da Cruz
6  *
7  * Auteur : Jose Marcio Martins da Cruz
8  * jose.marcio.mc@gmail.org
9  *
10  * Historique :
11  * Creation : Mon Apr 24 22:00:19 CEST 2006
12  *
13  * This program is free software, but with restricted license :
14  *
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  *
20  * More details about ze-filter license can be found at ze-filter
21  * web site : http://foss.jose-marcio.org
22  */
23 
24 
25 #ifndef __ZE_ORACLE_SCORES_H
26 
33 #define SPAM_CONN_RESOLVE_FAIL 1
34 #define SPAM_CONN_RESOLVE_FORGED 2
35 #define SPAM_CONN_RESOLVE_TEMPFAIL 3
36 #define SPAM_CONN_FALSE_LOCALHOST 4
37 #define SPAM_CONN_BL_SPAMTRAP 5
38 #define SPAM_CONN_BAD_EHLO 6
39 #define SPAM_CONN_FORGED_EHLO 7
40 #define SPAM_CONN_RBL 8
41 #define SPAM_CONN_NB 9
42 
43 #define SPAM_HTML_CLEAN_TOO_SHORT 3
44 #define SPAM_HTML_BASE64 4
45 #define SPAM_HTML_UNWANTED_TAGS 5
46 #define SPAM_HTML_TAGS_RATIO 6
47 #define SPAM_HTML_INVALID_TAGS 10
48 #define SPAM_HTML_NB 11
49 
50 #define SPAM_PLAIN_EMPTY 1
51 #define SPAM_PLAIN_BASE64 2
52 #define SPAM_PLAIN_NO_CHARSET 3
53 #define SPAM_PLAIN_TOO_SHORT 4
54 #define SPAM_PLAIN_NB 5
55 
56 #define SPAM_MSG_NO_TEXT_PART 1
57 #define SPAM_MSG_TOO_MUCH_HTML 2
58 #define SPAM_MSG_BAD_DATE 3
59 #define SPAM_MSG_FUTURE_DATE 4
60 #define SPAM_MSG_TOO_OLD_DATE 5
61 #define SPAM_MSG_UNWANTED_CHARSET 6
62 #define SPAM_MSG_BAD_EXPRESSIONS 8
63 #define SPAM_MSG_FORGED_POSTMASTER 9
64 #define SPAM_MSG_BAD_SENDER_ADDRESS 10
65 #define SPAM_MSG_BAD_DOMAIN_ADDRESS 11
66 #define SPAM_MSG_NO_SUBJECT 12
67 #define SPAM_MSG_RFC2822_HEADERS 13
68 #define SPAM_MSG_HEADERS_SYNTAX 14
69 #define SPAM_MSG_BASE64 15
70 #define SPAM_MSG_BASE64_SUBJECT 16
71 #define SPAM_MSG_UNWANTED_BOUNDARY 17
72 #define SPAM_MSG_HAS_BADRCPT 18
73 #define SPAM_MSG_MIME_ERRORS 19
74 #define SPAM_MSG_UNWANTED_MAILER 21
75 #define SPAM_MSG_MATCH_MIME_PARTS 22
76 #define SPAM_MSG_HAS_SPAMTRAP 23
77 #define SPAM_MSG_TOO_SHORT 24
78 #define SPAM_MSG_BAD_NULL_SENDER 25
79 #define SPAM_MSG_SUBJECT_HI_CAPS 26
80 #define SPAM_MSG_CONTENT_ID 27
81 #define SPAM_MSG_EMPTY_ATTACHMENT 28
82 #define SPAM_MSG_SUBJECT_NO_ALPHA 29
83 #define SPAM_MSG_SIZE_000_010 30
84 #define SPAM_MSG_SIZE_010_020 31
85 #define SPAM_MSG_SIZE_020_040 32
86 #define SPAM_MSG_SIZE_040_080 33
87 #define SPAM_MSG_SIZE_080_160 34
88 #define SPAM_MSG_SIZE_160_999 35
89 #define SPAM_MSG_NB 36
90 
91 #define SPAM_MIME_CONTENT_ID 1
92 
93 #define SPAM_GLOB_TAGGED 1
94 
95 #define ORACLE_TYPE_CONN 1
96 #define ORACLE_TYPE_MSG 2
97 #define ORACLE_TYPE_HTML 3
98 #define ORACLE_TYPE_PLAIN 4
99 #define ORACLE_TYPE_NB 5
100 
101 #define ORACLE_TYPE_GLOB 255
102 
103 
104 char *oracle_get_label(int, int);
105 double oracle_get_score(int, int);
106 bool oracle_set_score(int, int, double);
107 
108 long oracle_get_count(int, int);
109 long oracle_set_count(int, int, long);
110 long oracle_inc_count(int, int);
111 
112 void oracle_stats_update(int );
113 void oracle_stats_get(double *, double *, long *,
114  double *, double *,long *);
115 
116 bool oracle_dump_counters(int , bool);
117 bool oracle_read_counters();
118 bool oracle_save_counters();
119 
120 bool oracle_read_scores();
121 
122 bool load_oracle_defs(char *cfdir, char *fname);
123 void dump_oracle_defs();
124 
125 bool oracle_check_enabled(int, int);
126 
127 int oracle_compute_score(char *, char *, spamchk_T *);
128 
129 
130 
133 # define __ZE_ORACLE_SCORES_H 1
134 #endif /* __ZE_ORACLE_SCORES_H */
135 
bool oracle_save_counters()
bool oracle_read_counters()
int oracle_compute_score(char *, char *, spamchk_T *)
long oracle_get_count(int, int)
bool oracle_set_score(int, int, double)
void oracle_stats_get(double *, double *, long *, double *, double *, long *)
double oracle_get_score(int, int)
long oracle_inc_count(int, int)
bool load_oracle_defs(char *cfdir, char *fname)
long oracle_set_count(int, int, long)
void oracle_stats_update(int)
void dump_oracle_defs()
char * oracle_get_label(int, int)
bool oracle_dump_counters(int, bool)
bool oracle_check_enabled(int, int)
bool oracle_read_scores()