1#ifndef _DSN_BUF_H_INCLUDED_ 2#define _DSN_BUF_H_INCLUDED_ 3 4/*++ 5/* NAME 6/* dsn_buf 3h 7/* SUMMARY 8/* delivery status buffer 9/* SYNOPSIS 10/* #include <dsn_buf.h> 11/* DESCRIPTION 12/* .nf 13 14 /* 15 * Utility library. 16 */ 17#include <vstring.h> 18 19 /* 20 * Global library. 21 */ 22#include <dsn.h> 23 24 /* 25 * Delivery status buffer, Postfix-internal form. 26 */ 27typedef struct { 28 DSN dsn; /* convenience */ 29 /* Formal members. */ 30 VSTRING *status; /* RFC 3463 */ 31 VSTRING *action; /* RFC 3464 */ 32 VSTRING *mtype; /* null or remote MTA type */ 33 VSTRING *mname; /* null or remote MTA name */ 34 VSTRING *dtype; /* null, smtp, x-unix */ 35 VSTRING *dtext; /* null, RFC 2821, sysexits.h */ 36 /* Informal free text. */ 37 VSTRING *reason; /* free text */ 38} DSN_BUF; 39 40#define DSB_DEF_ACTION ((char *) 0) 41 42#define DSB_SKIP_RMTA ((char *) 0), ((char *) 0) 43#define DSB_MTYPE_NONE ((char *) 0) 44#define DSB_MTYPE_DNS "dns" /* RFC 2821 */ 45 46#define DSB_SKIP_REPLY (char *) 0, " " /* XXX Bogus? */ 47#define DSB_DTYPE_NONE ((char *) 0) 48#define DSB_DTYPE_SMTP "smtp" /* RFC 2821 */ 49#define DSB_DTYPE_UNIX "x-unix" /* sysexits.h */ 50#define DSB_DTYPE_SASL "x-sasl" /* libsasl */ 51 52extern DSN_BUF *dsb_create(void); 53extern DSN_BUF *PRINTFLIKE(8, 9) dsb_update(DSN_BUF *, const char *, const char *, const char *, const char *, const char *, const char *, const char *,...); 54extern DSN_BUF *PRINTFLIKE(3, 4) dsb_simple(DSN_BUF *, const char *, const char *,...); 55extern DSN_BUF *PRINTFLIKE(4, 5) dsb_unix(DSN_BUF *, const char *, const char *, const char *,...); 56extern DSN_BUF *dsb_formal(DSN_BUF *, const char *, const char *, const char *, const char *, const char *, const char *); 57extern DSN_BUF *dsb_status(DSN_BUF *, const char *); 58extern void dsb_reset(DSN_BUF *); 59extern void dsb_free(DSN_BUF *); 60 61 /* 62 * Early implementations of the DSN structure represented unavailable 63 * information with null pointers. This resulted in hard to maintain code. 64 * We now use empty strings instead, so there is no need anymore to convert 65 * empty strings to null pointers in the macro below. 66 */ 67#define DSN_FROM_DSN_BUF(dsb) \ 68 DSN_ASSIGN(&(dsb)->dsn, \ 69 vstring_str((dsb)->status), \ 70 vstring_str((dsb)->action), \ 71 vstring_str((dsb)->reason), \ 72 vstring_str((dsb)->dtype), \ 73 vstring_str((dsb)->dtext), \ 74 vstring_str((dsb)->mtype), \ 75 vstring_str((dsb)->mname)) 76 77/* LICENSE 78/* .ad 79/* .fi 80/* The Secure Mailer license must be distributed with this software. 81/* AUTHOR(S) 82/* Wietse Venema 83/* IBM T.J. Watson Research 84/* P.O. Box 704 85/* Yorktown Heights, NY 10598, USA 86/*--*/ 87 88#endif 89