ze-filter  (ze-filter-0.8.0-develop-180218)
ze-modules.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 : Sat Jun 2 22:18:08 CEST 2007
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_MODULES_H
26 
27 #define MOD_API_MAJOR 0x00
28 #define MOD_API_MINOR 0x02
29 #define MOD_API_PATCH 0x00
30 
31 #define MOD_VERSION ((MOD_API_MAJOR << 16) | (MOD_API_MINOR << 8) | MOD_API_PATCH)
32 
33 #define MOD_API_VERSION "0.01.00"
34 
35 #define MODR_CONTINUE 0x0000
36 #define MODR_REJECT 0x0001
37 #define MODR_TEMPFAIL 0x0002
38 
39 #define MODF_QUARANTINE 0x0100
40 #define MODF_STOP_CHECKS 0x0200
41 
42 #define MOD_QUARANTINE(flag) (((flag) & MODF_QUARANTINE) != 0)
43 #define MOD_STOP_CHECKS(flag) (((flag) & MODF_STOP_CHECKS) != 0)
44 
45 
46 typedef struct
47 {
48  char *name;
49  char *author;
50  char *version;
53 } mod_info_T;
54 
55 
56 typedef struct
57 {
58  int callback;
59  char *id;
60  char *claddr;
61  char *clname;
62  char *helo;
63  char *from;
64  char *rcpt;
65  char *sfile;
66  bool xfiles;
69  int result;
70  int flags;
71  char code[8];
72  char xcode[8];
73  char reply[64];
74  char modname[32];
75 } mod_ctx_T;
76 
77 typedef struct
78 {
79  char *moddir;
80  bool enable;
81  char *args;
84 } mod_open_T;
85 
86 
87 bool load_all_modules(char *cfdir, char *modcf, char *moddir);
88 
89 bool module_info();
90 
91 bool module_call(int callback, int step, mod_ctx_T * arg);
92 
93 bool module_service(int why);
94 
95 # define __ZE_MODULES_H 1
96 #endif /* __ZE_MODULES_H */
char * args
Definition: ze-modules.h:81
char * name
Definition: ze-modules.h:48
bool module_service(int why)
Definition: ze-modules.c:488
uint32_t calloffer
Definition: ze-modules.h:51
char * clname
Definition: ze-modules.h:61
uint32_t calloffer
Definition: ze-modules.h:83
char * helo
Definition: ze-modules.h:62
char * version
Definition: ze-modules.h:50
char * rcpt
Definition: ze-modules.h:64
uint32_t callrequest
Definition: ze-modules.h:82
char * from
Definition: ze-modules.h:63
msg_scores_T * raw_scores
Definition: ze-modules.h:67
char * author
Definition: ze-modules.h:49
bool module_info()
Definition: ze-modules.c:380
char * id
Definition: ze-modules.h:59
uint32_t callrequest
Definition: ze-modules.h:52
int callback
Definition: ze-modules.h:58
bool enable
Definition: ze-modules.h:80
msg_scores_T * net_scores
Definition: ze-modules.h:68
bool module_call(int callback, int step, mod_ctx_T *arg)
Definition: ze-modules.c:421
bool xfiles
Definition: ze-modules.h:66
int result
Definition: ze-modules.h:69
char * moddir
Definition: ze-modules.h:79
bool load_all_modules(char *cfdir, char *modcf, char *moddir)
Definition: ze-modules.c:318
int flags
Definition: ze-modules.h:70
char * sfile
Definition: ze-modules.h:65
long uint32_t
Definition: ze-sys.h:489
char * claddr
Definition: ze-modules.h:60