Qsmtp  0.30dev
userfilters.h
Go to the documentation of this file.
1 
4 #ifndef USERFILTERS_H
5 #define USERFILTERS_H
6 
7 #include "qsmtpd.h"
8 #include <sstring.h>
9 
10 #include <sys/queue.h>
11 #include <sys/types.h>
12 
13 struct userconf;
14 
23 };
24 
25 extern const char **globalconf;
26 
39 extern int getfile(const struct userconf *ds, const char *fn, enum config_domain *type, const unsigned int flags);
40 
41 extern long getsetting(const struct userconf *, const char *, enum config_domain *);
42 extern long getsettingglobal(const struct userconf *, const char *, enum config_domain *);
43 
48  FILTER_ERROR = -1,
55 };
56 
61 static inline int
63 {
64  return ((r > FILTER_PASSED) && (r != FILTER_WHITELISTED));
65 }
66 
75 typedef enum filter_result (*rcpt_cb)(const struct userconf *ds, const char **logmsg, enum config_domain *t);
76 
77 extern rcpt_cb rcpt_cbs[];
78 extern rcpt_cb late_rcpt_cbs[];
79 
80 extern const char *blocktype[];
81 
82 extern void logwhitelisted(const char *, const int, const int);
83 
84 #define THISRCPT (thisrecip->to.s)
85 
86 #endif
Definition: userfilters.h:53
long getsetting(const struct userconf *, const char *, enum config_domain *)
Definition: getfile.c:140
const char ** globalconf
Definition: qsmtpd.c:78
config_domain
describe where the domain a read config value is originating from
Definition: userfilters.h:18
enum filter_result(* rcpt_cb)(const struct userconf *ds, const char **logmsg, enum config_domain *t)
this is a function for a user filter
Definition: userfilters.h:75
long getsettingglobal(const struct userconf *, const char *, enum config_domain *)
Definition: getfile.c:157
Definition: userfilters.h:54
Definition: userfilters.h:49
int getfile(const struct userconf *ds, const char *fn, enum config_domain *type, const unsigned int flags)
Definition: getfile.c:19
Definition: userconf.h:10
Definition: userfilters.h:51
static int filter_denied(const enum filter_result r)
check if the given filter code was a denied code
Definition: userfilters.h:62
Definition: userfilters.h:20
const char * blocktype[]
Definition: rcpt_filters.c:56
Definition: userfilters.h:52
Definition: userfilters.h:22
Definition: userfilters.h:48
definitions for common parts from Qsmtpd exported from qsmtpd.c
Definition: userfilters.h:21
definition of string record and headers of corresponding helper functions
Definition: userfilters.h:50
filter_result
describes the result of a policy filter
Definition: userfilters.h:47
void logwhitelisted(const char *, const int, const int)
Definition: rcpt_filters.c:65
rcpt_cb rcpt_cbs[]
Definition: rcpt_filters.c:29
Definition: userfilters.h:19