smf_session.h File Reference

Defines SMFSession_T datatype and related functions. More...

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

Go to the source code of this file.

Data Structures

struct  SMFSession_T
 Holds spmfilter session data. More...
 

Functions

SMFSession_Tsmf_session_new (void)
 Create a new SMFSession_T object.
 
void smf_session_free (SMFSession_T *session)
 Free a SMFSession_T object.
 
void smf_session_set_helo (SMFSession_T *session, char *helo)
 Set helo for session.
 
char * smf_session_get_helo (SMFSession_T *session)
 Get session helo.
 
void smf_session_set_xforward_addr (SMFSession_T *session, char *xfwd)
 Set xforward addr.
 
char * smf_session_get_xforward_addr (SMFSession_T *session)
 Get xforward address.
 
void smf_session_set_response_msg (SMFSession_T *session, char *rmsg)
 Set response message.
 
char * smf_session_get_response_msg (SMFSession_T *session)
 Get response message.
 
SMFEnvelope_Tsmf_session_get_envelope (SMFSession_T *session)
 Retrieve the SMFEnvelope_T object from the current session.
 
void smf_session_set_message_file (SMFSession_T *session, char *fp)
 Set path for message file.
 
char * smf_session_get_message_file (SMFSession_T *session)
 Get message file.
 
char * smf_session_get_id (SMFSession_T *session)
 Get session id.
 

Detailed Description

Defines SMFSession_T datatype and related functions.

Each message is processed in a new session, with unique session id. The session data itself is stored in a SMFSession_T object, whereas the email content is stored on disk instead, but connection informations and message headers are hold in memory. If you need to modify an email in the current session, you have to use the session functions.

If a header of a session object has been modified, the session will be marked as "dirty" - that means the header will be flushed to disk before the final delivery is initialized, to keep the message in sync with the modified data.

Function Documentation

void smf_session_free ( SMFSession_T session)

Free a SMFSession_T object.

Parameters
sessiona SMFSession_T object
SMFEnvelope_T* smf_session_get_envelope ( SMFSession_T session)

Retrieve the SMFEnvelope_T object from the current session.

Parameters
sessiona SMFSession_T object
Returns
SMFEnvelope_T object
char* smf_session_get_helo ( SMFSession_T session)

Get session helo.

Parameters
sessionSMFSession_T object
Returns
helo
char* smf_session_get_id ( SMFSession_T session)

Get session id.

Parameters
sessionSMFSession_T object
Returns
session id
char* smf_session_get_message_file ( SMFSession_T session)

Get message file.

Parameters
sessionSMFSession_T object
Returns
path to message file
char* smf_session_get_response_msg ( SMFSession_T session)

Get response message.

Parameters
sessionSMFSession_T object
Returns
response_message
char* smf_session_get_xforward_addr ( SMFSession_T session)

Get xforward address.

Parameters
sessionSMFSession_T object
Returns
xforward address
SMFSession_T* smf_session_new ( void  )

Create a new SMFSession_T object.

Returns
a newly allocated SMFSession_T object
void smf_session_set_helo ( SMFSession_T session,
char *  helo 
)

Set helo for session.

Parameters
sessionSMFSession_T object
helohelo message
void smf_session_set_message_file ( SMFSession_T session,
char *  fp 
)

Set path for message file.

Parameters
sessionSMFSession_T object
fpmessage file path
void smf_session_set_response_msg ( SMFSession_T session,
char *  rmsg 
)

Set response message.

Parameters
sessionSMFSession_T object
rmsgresponse message
void smf_session_set_xforward_addr ( SMFSession_T session,
char *  xfwd 
)

Set xforward addr.

Parameters
sessionSMFSession_T object
xfwdxforward address