Chapter 3. Internet Message Format

Table of Contents
Quick start
Data types
Parser functions
Creation functions
Rendering of messages

libEtPan! implements Internet Message parser. Currently, format is RFC 2822. This module also allows to generate messages.

Warning

All allocation functions will take as argument allocated data and will store these data in the structure they will allocate. Data should be persistant during all the use of the structure and will be freed by the free function of the structure

allocation functions will return NULL on failure functions returning integer will be returning one of the following error code: MAILIMF_NO_ERROR, MAILIMF_ERROR_PARSE, MAILIMF_ERROR_MEMORY, MAILIMF_ERROR_INVAL, or MAILIMF_ERROR_FILE.

Quick start

You will need this module when you want to parse headers of messages or when you want to build message headers conformant to standards.

Parse message headers

You will use one of the four following functions, depending on your needs :

Render the message headers

Build your message headers, then use mailimf_fields_write (the Section called Header fields) to render the headers.