smf_envelope.h File Reference

Defines the SMFEnvelope_T data type and related functions. More...

#include "smf_list.h"
#include "smf_email_address.h"
#include "smf_message.h"
Include dependency graph for smf_envelope.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SMFEnvelope_T
 Message envelope object. More...
 

Typedefs

typedef void(* SMFRcptForeachFunc )(char *addr, void *user_data)
 The function signature for a callback to smf_envelope_foreach_rcpt()
 

Functions

SMFEnvelope_Tsmf_envelope_new (void)
 Creates a new SMFEnvelope_T object.
 
void smf_envelope_free (SMFEnvelope_T *envelope)
 Free SMFEnvelope_T object.
 
void smf_envelope_set_sender (SMFEnvelope_T *envelope, char *sender)
 Set sender to envelope.
 
char * smf_envelope_get_sender (SMFEnvelope_T *envelope)
 Get envelope sender.
 
int smf_envelope_add_rcpt (SMFEnvelope_T *envelope, char *rcpt)
 Add a new recipient to envelope.
 
void smf_envelope_foreach_rcpt (SMFEnvelope_T *envelope, SMFRcptForeachFunc callback, void *user_data)
 Recursively calls callback on each envelope recipient.
 
void smf_envelope_set_auth_user (SMFEnvelope_T *envelope, char *auth_user)
 Set auth user.
 
char * smf_envelope_get_auth_user (SMFEnvelope_T *envelope)
 Get auth user.
 
void smf_envelope_set_auth_pass (SMFEnvelope_T *envelope, char *auth_pass)
 Set auth password.
 
char * smf_envelope_get_auth_pass (SMFEnvelope_T *envelope)
 Get auth pass.
 
void smf_envelope_set_nexthop (SMFEnvelope_T *envelope, char *nexthop)
 Set nexthop.
 
char * smf_envelope_get_nexthop (SMFEnvelope_T *nexthop)
 Get nexthop.
 
void smf_envelope_set_message (SMFEnvelope_T *envelope, SMFMessage_T *message)
 Set SMFMessage_T object.
 
SMFMessage_Tsmf_envelope_get_message (SMFEnvelope_T *envelope)
 Get SMFMessage_T object of SMFEnvelope_T.
 

Detailed Description

Defines the SMFEnvelope_T data type and related functions.

A SMFEnvelope_T is used to delivery a SMFMessage_T via SMTP. The destination server can be set with smf_envelope_set_nexthop(). If the destination server requires smtp-auth login credentials, use smf_envelope_set_auth_user() and smf_envelope_set_auth_pass().

To create a new SMFEnvelope_T, use smf_envelope_new()

To destroy a SMFEnvelope_T use smf_envelope_free()

Typedef Documentation

typedef void(* SMFRcptForeachFunc)(char *addr, void *user_data)

The function signature for a callback to smf_envelope_foreach_rcpt()

Parameters
eaa SMFAddress_T object
user_dataUser-supplied callback data.

Function Documentation

int smf_envelope_add_rcpt ( SMFEnvelope_T envelope,
char *  rcpt 
)

Add a new recipient to envelope.

Parameters
envelopea SMFEnvelope_T
rcptrecipient address
Returns
0 on success or -1 in case of error
void smf_envelope_foreach_rcpt ( SMFEnvelope_T envelope,
SMFRcptForeachFunc  callback,
void *  user_data 
)

Recursively calls callback on each envelope recipient.

Parameters
envelopeSMFEnvelope_T object
callbackfunction to call on each recipient
user_datauser-supplied callback data
void smf_envelope_free ( SMFEnvelope_T envelope)

Free SMFEnvelope_T object.

Parameters
envelopeSMFEnvelope_T object
char* smf_envelope_get_auth_pass ( SMFEnvelope_T envelope)

Get auth pass.

Parameters
envelopeSMFEnvelope_T object
Returns
auth password
char* smf_envelope_get_auth_user ( SMFEnvelope_T envelope)

Get auth user.

Parameters
envelopeSMFEnvelope_T object
Returns
auth username
SMFMessage_T* smf_envelope_get_message ( SMFEnvelope_T envelope)

Get SMFMessage_T object of SMFEnvelope_T.

Parameters
envelopea SMFEnvelope_T object
Returns
a SMFMessage_T object
char* smf_envelope_get_nexthop ( SMFEnvelope_T envelope)

Get nexthop.

Parameters
envelopeSMFEnvelope_T object
Returns
nexthop
char* smf_envelope_get_sender ( SMFEnvelope_T envelope)

Get envelope sender.

Parameters
envelopeSMFEnvelope_T object
Returns
envelope sender
SMFEnvelope_T* smf_envelope_new ( void  )

Creates a new SMFEnvelope_T object.

Returns
an empty SMFEnvelope_T object
void smf_envelope_set_auth_pass ( SMFEnvelope_T envelope,
char *  auth_pass 
)

Set auth password.

Parameters
envelopeSMFEnvelope_T object
auth_passAuth password
void smf_envelope_set_auth_user ( SMFEnvelope_T envelope,
char *  auth_user 
)

Set auth user.

Parameters
envelopeSMFEnvelope_T object
auth_userAuth username
void smf_envelope_set_message ( SMFEnvelope_T envelope,
SMFMessage_T message 
)

Set SMFMessage_T object.

Parameters
envelopea SMFEnvelope_T object
messagea SMFMessage_T object
void smf_envelope_set_nexthop ( SMFEnvelope_T envelope,
char *  nexthop 
)

Set nexthop.

Parameters
envelopeSMFEnvelope_T object
nexthopnexthop
void smf_envelope_set_sender ( SMFEnvelope_T envelope,
char *  sender 
)

Set sender to envelope.

Parameters
envelopeSMFEnvelope_T object
senderenvelope sender address