Qsmtp  0.30dev
Functions
client.c File Reference

SMTP client code to parse server replies. More...

#include <qremote/client.h>
#include <netio.h>
#include <qdns.h>
#include <qremote/qremote.h>
#include <qremote/statuscodes.h>
#include <arpa/inet.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

Functions

void getrhost (const struct ips *m, const unsigned short idx)
 print remote host information to buffer More...
 
int checkreply (const char *status, const char **pre, const int mask)
 

Detailed Description

SMTP client code to parse server replies.

Function Documentation

int checkreply ( const char *  status,
const char **  pre,
const int  mask 
)

check the reply of the server

Parameters
statusstatus codes to print or NULL if not to
pretext to write to stdout before server reply if mask matches
maskbitmask for pre: 1: 2xx, 2: 4xx, 4: 5xx
Returns
the SMTP result code

status must be at least 3 bytes long but only the first 3 will have any effect. The first one is the status code writen on success (server response is 2xx), the second on on temporary error (4xx) and the third on permanent error (5xx). If no status code should be written status must be set to NULL. If the first character in status is ' ' no message will be printed for success messages.

void getrhost ( const struct ips m,
const unsigned short  idx 
)

print remote host information to buffer

Parameters
mthe currently active MX entry
sindex of the currently active IP address