Go to the first, previous, next, last section, table of contents.


Headers

/* Prefix header_ is reserved */
#include <mailutils/header.h>

So far we plan support for RFC822 and plan for RFC1522. with RFC1522 non ASCII characters will be encoded.

Function: int header_create (header_t *hdr, const char *blurb, size_t len, void *owner)
Initialize a hdr to a supported type. If blurb is not NULL, it is parsed.

Function: void header_destroy (header_t *hdr, void *owner)
The resources allocated for hdr are freed.

Function: int header_set_value (header_t hdr, const char *fn, const char *fv, size_t n, int replace)
Set the field-name fn to field-value fv of size n in hdr. If replace is non-zero the initial value is replaced, if zero it is appended.

Some basic macros are already provided for rfc822.

MU_HDR_RETURN_PATH
Return-Path
MU_HDR_RECEIVED
Received
MU_HDR_DATE
Date
MU_HDR_FROM
From
MU_HDR_RESENT_FROM
Resent-From
MU_HDR_SUBJECT
Subject
MU_HDR_SENDER
Sender
MU_HDR_RESENT_SENDER
Resent-SENDER
MU_HDR_TO
To
MU_HDR_RESENT_TO
Resent-To
MU_HDR_CC
Cc
MU_HDR_RESENT_CC
Resent-Cc
MU_HDR_BCC
Bcc
MU_HDR_RESENT_BCC
Resent-Bcc
MU_HDR_REPLY_TO
Reply-To
MU_HDR_RESENT_REPLY_TO
Resent-Reply-To
MU_HDR_MESSAGE_ID
Message-ID
MU_HDR_RESENT_MESSAGE_ID
Resent-Message-ID
MU_HDR_IN_REPLY_TO
In-Reply-To
MU_HDR_ENCRYPTED
Encrypted
MU_HDR_PRECEDENCE
Precedence
MU_HDR_STATUS
Status
MU_HDR_CONTENT_LENGTH
Content-Length
MU_HDR_CONTENT_TYPE
Content-Type
MU_HDR_MIME_VERSION
MIME-Version

Function: int header_get_value (header_t hdr, const char *fn, char *fv, size_t len, size_t *n)
Value of field-name fn is returned in buffer fv of size len. The number of bytes written is put in n.

Function: int header_aget_value (header_t hdr, const char *fn, char **fv)
The value is allocated.

Function: int header_get_stream (header_t hdr, stream_t *pstream)

Function: int header_set_size (header_t hdr, size_t *size)

Function: int header_set_lines (header_t hdr, size_t *lpines)


Go to the first, previous, next, last section, table of contents.