Message Header API

The Message header API allows programmers to create and manipulate RFC822-compliant message headers.

A header object is materialized as an opaque structure, imhdr_t. Header lines can be read, added and removed from the header using the message header API described below.

Other interfaces within the Sun Internet Mail SDK, but not included in this API, create, or access header objects.
While dequeuing a message, the header lines of that message may be read into a header structure with immd_read_header. In this case, imme_read_header creates a header object, reads header lines into it, and then returns a pointer to the structure. The structure may then be used with any of the other header routines.
Similarly, imme_write_header is used to write a header object to a message being enqueued.

The library defines a large number of header types defined as constants which are passed as parameters to the functions of this library. These constants are defined in the rfc822_header.h header file. This does not prevent programmers from defining new header types.


Note - By default, the SDK will not add the MIME version: and Content-type: header lines in the header. Therefore, those lines need to be inserted by the program in the main header unless the charset7 keyword is added in the channel definition (see below).

Example programs


The example C program create_header.c, is a test utility which can be used to create, read, and remove header lines in a simple header structure.




Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.