Qsmtp  0.30dev
Functions | Variables
greeting.c File Reference

function to parse the EHLO greeting response More...

#include <qremote/greeting.h>
#include <log.h>
#include <netio.h>
#include <qremote/qremote.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>

Functions

static int cb_size (const char *more)
 
static int cb_auth (const char *more)
 
int esmtp_check_extension (const char *input)
 check if the line contains a known ESMTP extension More...
 
static void errmsg_syntax (const char *phase)
 
int greeting (void)
 greet the server, try EHLO and fall back to HELO if needed More...
 

Variables

unsigned long remotesize
 
const char * auth_mechs
 
char auth_mechs_copy [996]
 

Detailed Description

function to parse the EHLO greeting response

Function Documentation

int esmtp_check_extension ( const char *  input)

check if the line contains a known ESMTP extension

Parameters
inputthe line as sent by the server (ommitting the leading "250 " or "250-")
Returns
the extension code detected
Return values
0no known extension code was found
-1a valid extension code was found, but the line had a parse error
int greeting ( void  )

greet the server, try EHLO and fall back to HELO if needed

Returns
the SMTP extensions supported
Return values
<0error code
-EDONEthe server reply was syntactically correct, but an error response

In case of incoming syntax errors the faulting line will be written to log.

Variable Documentation

const char* auth_mechs

the AUTH mechanisms supported by the remote host

char auth_mechs_copy[996]

copy of the AUTH mechanisms supported by the remote host, to avoid malloc()

unsigned long remotesize

the maximum size allow by the remote host or 0 if unlimited or unknown