Qsmtp
0.30dev
|
functions to get information from filterconf files More...
#include <qsmtpd/userfilters.h>
#include <control.h>
#include <diropen.h>
#include <qsmtpd/userconf.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
Functions | |
int | getfile (const struct userconf *ds, const char *fn, enum config_domain *type, const unsigned int flags) |
static long | checkconfig (const char *const *config, const char *flag, const size_t l) |
static long | getsetting_internal (const struct userconf *ds, const char *flag, enum config_domain *type, const unsigned int flags) |
long | getsetting (const struct userconf *ds, const char *flag, enum config_domain *type) |
long | getsettingglobal (const struct userconf *ds, const char *flag, enum config_domain *type) |
functions to get information from filterconf files
|
static |
search a value in a given list of config values
config | list of settings, last entry has to be NULL, list may be NULL |
flag | the value to find |
l | strlen(flag) |
0 | no match |
-1 | syntax error |
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 |