ze-filter  (ze-filter-0.8.0-develop-180218)
ze-grey.h
Go to the documentation of this file.
1 
2 /*
3  *
4  * ze-filter - Mail Server Filter for sendmail
5  *
6  * Copyright (c) 2001-2018 - Jose-Marcio Martins da Cruz
7  *
8  * Auteur : Jose Marcio Martins da Cruz
9  * jose.marcio.mc@gmail.org
10  *
11  * Historique :
12  * Creation : Fri Jan 21 14:26:51 CET 2005
13  *
14  * This program is free software, but with restricted license :
15  *
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  * More details about ze-filter license can be found at ze-filter
22  * web site : http://foss.jose-marcio.org
23  */
24 
25 
26 #ifndef __ZE_GREY_H
27 
35 #define GREY_OK 200
36 #define GREY_WAIT 400
37 #define GREY_REJECT 500
38 #define GREY_ERROR 700
39 #define GREY_DUNNO 100
40 
41 #define GREY_EMAIL_NONE 0
42 #define GREY_EMAIL_FULL 1
43 #define GREY_EMAIL_USER 2
44 #define GREY_EMAIL_HOST 3
45 
46 #define GREY_ADDR_NONE 0
47 #define GREY_ADDR_FULL 1
48 #define GREY_ADDR_NET 2
49 
50 #define GREY_STANDALONE 0
51 #define GREY_CLIENT 1
52 #define GREY_SERVER 2
53 
54 #define GREY_DW_NONE 0x00
55 #define GREY_DW_NULLSENDER 0x01
56 #define GREY_DW_BAD_RESOLVE 0x02
57 #define GREY_DW_DOMAIN_MISMATCH 0x04
58 #define GREY_DW_BAD_CLIENT 0x08
59 #define GREY_DW_SPAMTRAP 0x10
60 #define GREY_DW_BAD_RCPT 0x20
61 #define GREY_DW_BAD_MX 0x40
62 
63 #define GREY_DW_ALL 0xFFFF
64 
65 #define GDB_NONE 0
66 #define GDB_PENDING 1
67 #define GDB_VALID 2
68 #define GDB_WHITELIST 3
69 #define GDB_BLACKLIST 4
70 #define GDB_ALL 0xFF
71 
72 #define GREY_ARGS 16
73 #define ARG_DATE_INIT 0
74 #define ARG_DATE_UPDT 1
75 #define ARG_IP 2
76 #define ARG_HOSTNAME 3
77 #define ARG_FROM 4
78 #define ARG_RESOLVE 5
79 #define ARG_COUNT 6
80 #define ARG_FLAGS 7
81 
82 int grey_check(char *, char *, char *, char *, bool *, bool);
83 int grey_validate(char *, char *, char *, char *);
84 
85 typedef bool(*greycleanup_F) (char *);
86 
87 bool grey_init(char *, bool, int);
88 bool grey_reload();
89 void grey_close();
90 
91 bool grey_set_tuples(char *ip, char *from, char *to);
92 
93 bool grey_set_delays(time_t tp_min_norm, time_t tp_max_norm,
94  time_t tp_min_null, time_t tp_max_null);
95 
96 bool grey_set_lifetime(time_t tv, time_t tw, time_t tb);
97 
98 bool grey_set_max_pending(int normal, int bounce);
99 
100 bool grey_set_cleanup_interval(time_t tclean);
101 
102 void grey_set_compat_domain_check(bool enable);
103 
104 bool grey_list(int, int);
105 
106 void grey_set_dewhite_flags(char *, bool);
107 
108 int grey_dump(int fd, char *which, time_t dt);
109 
110 int grey_upload(char *fname, char *which);
111 
112 int grey_dbcount(int);
113 
114 bool grey_remove_entry(char *where, char *key);
115 
116 bool grey_remove_entries_from_file(char *where, char *fname);
117 
120 #define __ZE_GREY_H 1
121 #endif /* __ZE_GREY_H */
void grey_set_compat_domain_check(bool enable)
Definition: ze-grey.c:473
bool grey_set_cleanup_interval(time_t tclean)
Definition: ze-grey.c:459
bool grey_set_tuples(char *ip, char *from, char *to)
Definition: ze-grey.c:355
bool grey_set_delays(time_t tp_min_norm, time_t tp_max_norm, time_t tp_min_null, time_t tp_max_null)
Definition: ze-grey.c:399
bool grey_remove_entry(char *where, char *key)
Definition: ze-grey.c:1019
int grey_check(char *, char *, char *, char *, bool *, bool)
Definition: ze-grey.c:491
Error dont have limits h nor values h typedef int bool
Definition: ze-sys.h:261
int grey_validate(char *, char *, char *, char *)
Definition: ze-grey.c:825
bool grey_list(int, int)
bool(* greycleanup_F)(char *)
Definition: ze-grey.h:85
bool grey_set_lifetime(time_t tv, time_t tw, time_t tb)
Definition: ze-grey.c:422
int grey_upload(char *fname, char *which)
Definition: ze-grey.c:2774
bool grey_init(char *, bool, int)
Definition: ze-grey.c:1326
void grey_close()
Definition: ze-grey.c:1381
void grey_set_dewhite_flags(char *, bool)
Definition: ze-grey.c:1772
bool grey_set_max_pending(int normal, int bounce)
Definition: ze-grey.c:442
int grey_dbcount(int)
Definition: ze-grey.c:3046
bool grey_remove_entries_from_file(char *where, char *fname)
Definition: ze-grey.c:1031
int grey_dump(int fd, char *which, time_t dt)
Definition: ze-grey.c:2685
bool grey_reload()
Definition: ze-grey.c:1393