Next: , Previous: Envelope, Up: libmailbox


3.1.6 Headers

     /* Prefix mu_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 mu_header_create (mu_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 mu_header_destroy (mu_header_t *hdr, void *owner)

The resources allocated for hdr are freed.

— Function: void* mu_header_get_owner (mu_header_t *hdr)
— Function: int mu_header_is_modified (mu_header_t hdr)
— Function: int mu_header_clear_modified (mu_header_t hdr)
— Function: int mu_header_set_value (mu_header_t hdr, const char *fn, const char *fv, int n)

Some basic macros are already provided for RFC822.

MU_HEADER_UNIX_FROM
From
MU_HEADER_RETURN_PATH
Return-Path
MU_HEADER_RECEIVED
Received
MU_HEADER_DATE
Date
MU_HEADER_FROM
From
MU_HEADER_SENDER
Sender
MU_HEADER_RESENT_FROM
Resent-From
MU_HEADER_SUBJECT
Subject
MU_HEADER_SENDER
Sender
MU_HEADER_RESENT_SENDER
Resent-SENDER
MU_HEADER_TO
To
MU_HEADER_RESENT_TO
Resent-To
MU_HEADER_CC
Cc
MU_HEADER_RESENT_CC
Resent-Cc
MU_HEADER_BCC
Bcc
MU_HEADER_RESENT_BCC
Resent-Bcc
MU_HEADER_REPLY_TO
Reply-To
MU_HEADER_RESENT_REPLY_TO
Resent-Reply-To
MU_HEADER_MESSAGE_ID
Message-ID
MU_HEADER_RESENT_MESSAGE_ID
Resent-Message-ID
MU_HEADER_IN_REPLY_TO
In-Reply-To
MU_HEADER_REFERENCE
Reference
MU_HEADER_REFERENCES
References
MU_HEADER_ENCRYPTED
Encrypted
MU_HEADER_PRECEDENCE
Precedence
MU_HEADER_STATUS
Status
MU_HEADER_CONTENT_LENGTH
Content-Length
MU_HEADER_CONTENT_LANGUAGE
Content-Language
MU_HEADER_CONTENT_TRANSFER_ENCODING
Content-transfer-encoding
MU_HEADER_CONTENT_ID
Content-ID
MU_HEADER_CONTENT_TYPE
Content-Type
MU_HEADER_CONTENT_DESCRIPTION
Content-Description
MU_HEADER_CONTENT_DISPOSITION
Content-Disposition
MU_HEADER_CONTENT_MD5
Content-MD5
MU_HEADER_MIME_VERSION
MIME-Version
MU_HEADER_X_UIDL
X-UIDL
MU_HEADER_X_UID
X-UID
MU_HEADER_X_IMAPBASE
X-IMAPbase
MU_HEADER_ENV_SENDER
X-Envelope-Sender
MU_HEADER_ENV_DATE
X-Envelope-Date
MU_HEADER_FCC
Fcc
MU_HEADER_DELIVERY_DATE
Delivery-date
MU_HEADER_ENVELOPE_TO
Envelope-to

— Function: int mu_header_get_value (mu_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 mu_header_aget_value (mu_header_t hdr, const char *fn, char **fv)

The value is allocated.

— Function: int mu_header_get_address (mu_header_t hdr, const char *buf, address_t *addr)
— Function: int mu_header_get_stream (mu_header_t hdr, stream_t *stream)
— Function: int mu_header_set_stream (mu_header_t hdr, stream_t stream, void *)
— Function: int mu_header_get_field_count (mu_header_t hdr, size_t *count)
— Function: int mu_header_get_field_value (mu_header_t hdr, size_t index, char *, size_t, size_t *)
— Function: int mu_header_get_field_name (mu_header_t hdr, size_t index, char *, size_t, size_t *)
— Function: int mu_header_aget_field_value (mu_header_t hdr, size_t index, char **)
— Function: int mu_header_aget_field_name (mu_header_t hdr, size_t index, char **)
— Function: int mu_header_get_value_unfold (mu_header_t hdr, const char *name, char *buffer, size_t buflen, size_t *n)
— Function: int mu_header_aget_value_unfold (mu_header_t hdr, const char *name, char **value)
— Function: int mu_header_get_field_value_unfold (mu_header_t hdr, size_t num, char *buf, size_t buflen, size_t *nwritten)
— Function: int mu_header_aget_field_value_unfold (mu_header_t hdr, size_t num, char **value);
— Function: int mu_header_size (mu_header_t hdr, size_t *);
— Function: int mu_header_lines (mu_header_t hdr, size_t *);
— Function: int mu_header_set_set_value (mu_header_t hdr, int (*_set_value) (mu_header_t, const char *, const char *, int), void *);
— Function: int mu_header_set_get_value (mu_header_t hdr, int (*_get_value) (mu_header_t, const char *, char *, size_t, size_t *), void *);
— Function: int mu_header_set_get_fvalue (mu_header_t hdr, int (*_get_value) (mu_header_t, const char *, char *, size_t, size_t *), void *);
— Function: int mu_header_set_size (mu_header_t hdr, int (*_size) (mu_header_t, size_t *), void *);
— Function: int mu_header_set_lines (mu_header_t hdr, int (*_lines) (mu_header_t, size_t *), void *);
— Function: int mu_header_set_fill (mu_header_t hdr, int (*_fill) (mu_header_t, char *, size_t, mu_off_t, size_t *), void *owner);