immd_read_failure_log - Reads a message delivery failure log from a message being dequeued.
#include <imta.h>
int immd_read_failure_log(immd_t md, char **date, char **text);
Messages may contain a delivery failure log detailing why previous failed delivery attempts, if any. This log may be read only after the message content (headers and body) has been read. Upon success, the date of the failure is placed in the buffer referenced by date, and the reason for this failure is placed in the buffer referenced by text.
Each call to immd_read_failure_log() overwrites values previously output by calls to immd_read_failure_log() or immd_read_text(). Therefore, the contents of text and date must be copied to a buffer allocated by the caller if it is to be re-used after immd_read_failure_log() is again called.
md points to the dequeue context initilized earlier with immd_init(). Both are NULL-terminated. The value output by previous calls to immd_read_text() is lost.
Delivery failure logs are generated with immd_defer().
immd_read_failure_log() returns IMRC_OK when successful.
If no failure log is present, or if all of them have been read, then a value of IMRC_EOF is returned.
In the event of an error, one of the following error codes is returned
The reason for the failure can be obtained by calling imta_error() immediately afterwards.
_______________________________________
immd_init(3) , immd_read_text(3) , imta_error(3) , immd_defer(3)