|
Qsmtp
0.30dev
|
common function definitions for all user filters More...
Go to the source code of this file.
Macros | |
| #define | THISRCPT (thisrecip->to.s) |
Typedefs | |
| typedef enum filter_result(* | rcpt_cb) (const struct userconf *ds, const char **logmsg, enum config_domain *t) |
| this is a function for a user filter More... | |
Enumerations | |
| enum | config_domain { CONFIG_NONE = 0, CONFIG_USER = 1, CONFIG_DOMAIN = 2, CONFIG_GLOBAL = 4 } |
| describe where the domain a read config value is originating from More... | |
| enum | filter_result { FILTER_ERROR = -1, FILTER_PASSED = 0, FILTER_DENIED_WITH_MESSAGE = 1, FILTER_DENIED_UNSPECIFIC = 2, FILTER_DENIED_NOUSER = 3, FILTER_DENIED_TEMPORARY = 4, FILTER_WHITELISTED = 5 } |
| describes the result of a policy filter More... | |
Functions | |
| int | getfile (const struct userconf *ds, const char *fn, enum config_domain *type, const unsigned int flags) |
| long | getsetting (const struct userconf *, const char *, enum config_domain *) |
| long | getsettingglobal (const struct userconf *, const char *, enum config_domain *) |
| static int | filter_denied (const enum filter_result r) |
| check if the given filter code was a denied code More... | |
| void | logwhitelisted (const char *, const int, const int) |
Variables | |
| const char ** | globalconf |
| rcpt_cb | rcpt_cbs [] |
| rcpt_cb | late_rcpt_cbs [] |
| const char * | blocktype [] |
common function definitions for all user filters
| rcpt_cb |
this is a function for a user filter
| ds | the struct with the paths of domain- and userpath |
| logmsg | store here a reference to the message to write into logfile or NULL if you logged yourself |
| type | which policy matched (user, domain, global) |
| enum config_domain |
describe where the domain a read config value is originating from
| enum filter_result |
describes the result of a policy filter
|
inlinestatic |
check if the given filter code was a denied code
| r | the code to check |
| int getfile | ( | const struct userconf * | ds, |
| const char * | fn, | ||
| enum config_domain * | type, | ||
| const unsigned int | flags | ||
| ) |
check in user and domain directory if a file with given filename exists
| ds | strings of user and domain directory |
| fn | filename to search |
| type | if user, domain or global directory matched, undefined if result != 1 |
| flags | search flags |
| -1 | on error (errno is set) |
| long getsetting | ( | const struct userconf * | ds, |
| const char * | flag, | ||
| enum config_domain * | type | ||
| ) |
get setting from user or domain filterconf file
| ds | struct with the user/domain config info |
| flag | name of the setting to find (case sensitive) |
| type | if user or domain directory matched, undefined if result != 1) |
| 1 | boolean setting or no number given |
| 0 | setting not found |
| -1 | on syntax error |
| long getsettingglobal | ( | const struct userconf * | ds, |
| const char * | flag, | ||
| enum config_domain * | type | ||
| ) |
use getsetting and fall back to /var/qmail/control if this finds nothing
| ds | struct with the user/domain config info |
| flag | name of the setting to find (case sensitive) |
| type | if user, domain or global file matched, undefined if result != 1 |
| 1 | boolean setting or no number given |
| 0 | setting not found |
| -1 | on syntax error |
| void logwhitelisted | ( | const char * | reason, |
| const int | t, | ||
| const int | u | ||
| ) |
write message to syslog that a otherwise rejected mail has been passed because of whitelisting
| reason | reason of whitelisting |
| t | which type of filter caused blacklisting |
| u | which type of filter caused whitelisting |
| const char* blocktype[] |
string constants for the type of blocklists
| const char** globalconf |
contents of the global "filterconf" file (or NULL)
| rcpt_cb rcpt_cbs[] |
the user filters will be called in the order in this array
1.8.10