|
Qsmtp
0.30dev
|
functions for establishing connection to remote SMTP server More...
#include <qremote/conn.h>#include <control.h>#include <log.h>#include <netio.h>#include <qdns.h>#include <qremote/client.h>#include <qremote/qremote.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>Macros | |
| #define | SOCK_CLOEXEC 0 |
Functions | |
| static int | conn (const struct in6_addr remoteip, const struct in6_addr *outip) |
| create a socket and connect to the given ip More... | |
| int | tryconn (struct ips *mx, const struct in6_addr *outip4, const struct in6_addr *outip6) |
| void | getmxlist (char *remhost, struct ips **mx) |
Variables | |
| unsigned int | targetport = 25 |
functions for establishing connection to remote SMTP server
|
static |
create a socket and connect to the given ip
| remoteip | the target address |
| outip | the local IP the connection should originate from |
| void getmxlist | ( | char * | remhost, |
| struct ips ** | mx | ||
| ) |
get all IPs for the MX entries of target address
| remhost | target address |
| mx | list of MX entries will be stored here, memory will be malloced |
| int tryconn | ( | struct ips * | mx, |
| const struct in6_addr * | outip4, | ||
| const struct in6_addr * | outip6 | ||
| ) |
try to estabish an SMTP connection to one of the hosts in the ip list
| mx | list of IP adresses to try |
| outip4 | local IPv4 to bind |
| outip6 | local IPv6 to bind |
| -ENOENT | no IP address left to connect to |
Every entry where a connection attempt was made is marked with a priority of MX_PRIORITY_USED, the last one tried with MX_PRIORITY_CURRENT.
| unsigned int targetport = 25 |
the port on the destination host to connect to
1.8.10