imta_init, imta_end - Initializes or terminates dialog with the SIMS IMTA.
#include <imta.h>
int imta_init(const char *channel);
void imta_end();
imta_init() must be called prior to calling any other function in the MTA management (imta_...), message enqueue (imme_...), or message dequeue (immd_...) APIs.
imta_init() allocates and initializes internal data structures used by the SIMS IMTA. It should only be called once.
After all processing is completed, imta_end() should be called to release any allocated memory, and ensure that any open files are properly closed.
If the program is designed to dequeue messages from a IMTA queue, or enqueue messages to a IMTA queue, channel must contain the name of the channel to access. Note that this is the internal channel name, as specified in the /etc/opt/SUNWmail/imta/imta.cnf configuration file. Other programs should set channel to NULL.
In general, programs should not repeatedly call imta_init()and imta_end(). Either of these functions should generally be called only once per program run.
All active message dequeue or enqueue contexts should be disposed by calling immd_end()or imme_end() prior to calling imta_end(). If imta_end() is called while dequeue or enqueue contexts are still active, then any messages associated with active dequeue contexts will be deferred for later processing and any messages associated with active enqueue contexts will be deleted.
channel
name of the channel run by the program. See description
above.
imme_init() returns IMRC_OK when successful, and a negative error code otherwise.
Common sources of error include oversized channel string, lack of priviledges to read the MTA configuration, and mismatch between the current version of libimta.so and the site's compiled configuration. In the latter case, either the IMTA configuration or the character set tables need to be recompiled. A textual explanation of the failure can be obtained by calling imta_error() immediately afterwards.
_______________________________________