Qsmtp
0.30dev
|
functions for handling of control/smtproutes More...
#include <qremote/qremote.h>
#include <control.h>
#include <diropen.h>
#include <log.h>
#include <match.h>
#include <mmap.h>
#include <qdns.h>
#include <qremote/starttlsr.h>
#include <arpa/inet.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <syslog.h>
#include <unistd.h>
Functions | |
static int | hascolon (const char *s) |
check smtproutes entries for basic syntax errors More... | |
static int | validroute (const char *s) |
callback for loadlistfd() to check validity of smtprouts.d file contents More... | |
static const char * | tagvalue (char **lines, const unsigned int idx) |
static int | parse_route_params (struct ips **mx, const char *remhost, unsigned int *targetport, void *buf, const char *host, const char *port) |
parse the parts of an smtproute More... | |
struct ips * | smtproute (const char *remhost, const size_t reml, unsigned int *targetport) |
get static route for domain More... | |
Variables | |
char * | clientcertbuf |
static const char * | tags [] |
static unsigned int | tagmask |
functions for handling of control/smtproutes
|
static |
check smtproutes entries for basic syntax errors
|
static |
parse the parts of an smtproute
mx | MX result list is stored here |
remhost | original remote host |
targetport | targetport will be stored here |
buf | additional buffer, will be freed in case of fatal error |
host | host name of smtproute or NULL |
port | port string of smtproute of NULL |
0 | values were successfully parsed |
<0 | error code during setup |
The function will abort the program if a parse error occurs.
struct ips* smtproute | ( | const char * | remhost, |
const size_t | reml, | ||
unsigned int * | targetport | ||
) |
get static route for domain
remhost | target to look up |
reml | strlen(remhost) |
targetport | port on the remote host to connect to |
NULL | a runtime error occurred while reading the control file, errno is set |
If control/smtproutes contains a syntax error the program is terminated. On runtime error (out of memory) NULL is returned and errno is set.
|
static |
callback for loadlistfd() to check validity of smtprouts.d file contents
s | the line to check |
This not only checks the current line, but also sets tagmask to detect duplicate lines.
|
static |