definitions for common parts from Qremote exported from qremote.c
More...
#include "sstring.h"
#include <netinet/in.h>
Go to the source code of this file.
|
void | err_mem (const int) |
|
void | err_conf (const char *) |
|
void | err_confn (const char **, void *) |
| log a configuration error and exit More...
|
|
void | remote_common_setup (void) |
|
int | netget (const unsigned int terminate) |
| get one line from the network More...
|
|
void | write_status_raw (const char *str, const size_t len) |
| write raw status message to qmail-rspawn More...
|
|
void | write_status (const char *str) |
| write status message to qmail-rspawn More...
|
|
void | write_status_m (const char **strs, const unsigned int count) |
| write status messages to qmail-rspawn More...
|
|
struct ips * | smtproute (const char *, const size_t, unsigned int *) |
| get static route for domain More...
|
|
void | quitmsg (void) |
| send QUIT to the remote server and close the connection More...
|
|
definitions for common parts from Qremote exported from qremote.c
void err_confn |
( |
const char ** |
errmsg, |
|
|
void * |
freebuf |
|
) |
| |
log a configuration error and exit
- Parameters
-
errmsg | array of strings to combine to the message to log |
freebuf | a pointer to a buffer passed to free() after logging |
Use freebuf if the contents of this buffer need to be part of errmsg. If you do not have anything to free just pass NULL.
int netget |
( |
const unsigned int |
terminate | ) |
|
get one line from the network
- Parameters
-
terminate | if the program should be terminated on errors |
- Returns
- SMTP return code of the message or negative error code
- Return values
-
-EINVAL | the server send a reply that was syntactically invalid |
If an out of memory condition occurs the program will be terminated regardless of the terminate parameter.
If an error occurs and terminate is not set the connection will be shut down before the function returns unless the return code is -EINVAL.
send QUIT to the remote server and close the connection
This will properly shut down the connection to the remote server but will not terminate the program.
struct ips* smtproute |
( |
const char * |
remhost, |
|
|
const size_t |
reml, |
|
|
unsigned int * |
targetport |
|
) |
| |
get static route for domain
- Parameters
-
remhost | target to look up |
reml | strlen(remhost) |
targetport | port on the remote host to connect to |
- Returns
- MX list if route present
- Return values
-
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.
void write_status |
( |
const char * |
str | ) |
|
write status message to qmail-rspawn
- Parameters
-
This will include the trailing 0-byte in the output as qmail-rspawn awaits that as separator between the output fields.
void write_status_m |
( |
const char ** |
strs, |
|
|
const unsigned int |
count |
|
) |
| |
write status messages to qmail-rspawn
- Parameters
-
strs | the strings to write |
count | how many strings to write |
This will include the trailing 0-byte after the last entry in the output as qmail-rspawn awaits that as separator between the output fields.
void write_status_raw |
( |
const char * |
str, |
|
|
const size_t |
len |
|
) |
| |
write raw status message to qmail-rspawn
- Parameters
-
str | the data to write |
len | length of the data to write |
the DNS name of the remote server (forward-lookup), or NULL if the connection was done by IP
the DNS name (if present) and IP address of the remote server to be used in log messages
the SMTP extensions supported by the remote server