mmail_alloc()
Allocate a new mail message. Accepts an encoding to be used for Q-encoding message headers, or NULL if headers will not be in binary. Returns NULL on allocation failure or the object on success.
mmail_addbody()
Add a line of body text. If the encoding is 7bit, this cannot be more than 998 characters long (returning MMBODY_BODYLINESIZ), nor can it be binary (returning MMAIL_BODYBIN). Otherwise, returns MMAIL_MALLOC on allocation failure or MMAIL_OK on success.
mmail_addhead()
Add a message header. This function should be called before
mmail_addbody(), since mail encodings are determined by existing header data. Returns MMAIL_HEADMAX if the header type limit has been exceeded, MMAIL_HEADBODTOK if a binary header has been specified without an encoding (see
mmail_alloc()), MMAIL_MALLOC on allocation failure, per-header-type errors on header validation failure, or MMAIL_OK on success.
mmail_clone()
Completely clone a mail and its components. Returns NULL on allocation failure or the object on success.
mmail_errstring()
Convert an error code into a English-language equivalent, which is formatted with a leading capital letter and no ending punctuation.
mmail_free()
Completely free a mail message's memory.
mmail_reset()
Remove the components of a mail message, readying it for re-use in a parse or manual add.
mmail_write()
Normalise an e-mail and write it. If an encoding is specified, headers are Q-encoded with quoted-printable. If a transfer encoding is specified in a MIME message, the body is appropriate transcoded. Long lines (with quoted-printable transfer encoding) are soft line-broken. Returns 0 on underlying output stream failure, 1 on success.
mmbody_clone()
Clone a body line. Returns NULL on allocation failure or the object on success.
mmbody_delete()
Unlink a body line from its mail context and free its memory.
mmbody_get()
Get the first body line of a mail message. Returns NULL if no body lines are present or the object on success.
mmbody_next()
Returns a subsequent line within a mail body or NULL if this is the last.
mmhead_clone()
Clone a header line. Returns NULL on allocation failure or the object on success.
mmhead_delete()
Unlink a message header from its mail context and free its memory. Be careful calling this on important headers as existing message flags (such as transfer encodings) may be retained.
mmhead_find()
Find the first instance of a message header. Returns the header or NULL if none exists.
mmhead_nextchain()
Proceed to the next header of the same type. Returns the header or NULL if none exists.
mmhead_nextset()
Proceed to the next header in a message. Returns the header or NULL if none exists.
mmp_alloc()
Allocate a parse routine with a given encoding (which is passed along to all generated messages), error message function, warning message function, and private data. Returns NULL on allocation failure or the object on success.
mmp_char()
Parse a single line of input into a mail message. Returns 0 on failure, 1 on success (errors/warnings will be reported via the provided callback functions).
mmp_col()
Current line column of a parsing sequence.
mmp_detach()
Detach a mail message from the parsing context. The detached message must be freed manually. Returns NULL if no message exists (has already been detached) or the object on success.
mmp_end()
End a parsing sequence. Returns 0 on failure, 1 on success (errors/warnings will be reported via the provided callback functions).
mmp_free()
Free a parsing sequence and, if it has not been detached with
mmp_detach(), any contained in-parse message.
mmp_line()
Current line number of a parsing sequence.
mmp_mmail()
Get a pointer to the currently-parsed mail message. Returns NULL if no message exists (has been detached) or the object on success.
mmp_reset()
Reset a parse sequence. Calls through to
mmail_reset() if the in-parse message has not been detached, else a new message is allocated. Returns 0 if memory allocation fails (in the event that the prior message has been detached), 1 on success.