3 #ifndef _DSN_BUF_H_INCLUDED_
4 #define _DSN_BUF_H_INCLUDED_
10 /* delivery status buffer
12 /* #include <dsn_buf.h>
27 * Delivery status buffer, Postfix-internal form.
30 DSN dsn
; /* convenience */
32 VSTRING
*status
; /* RFC 3463 */
33 VSTRING
*action
; /* RFC 3464 */
34 VSTRING
*mtype
; /* null or remote MTA type */
35 VSTRING
*mname
; /* null or remote MTA name */
36 VSTRING
*dtype
; /* null, smtp, x-unix */
37 VSTRING
*dtext
; /* null, RFC 2821, sysexits.h */
38 /* Informal free text. */
39 VSTRING
*reason
; /* free text */
42 #define DSB_DEF_ACTION ((char *) 0)
44 #define DSB_SKIP_RMTA ((char *) 0), ((char *) 0)
45 #define DSB_MTYPE_NONE ((char *) 0)
46 #define DSB_MTYPE_DNS "dns" /* RFC 2821 */
48 #define DSB_SKIP_REPLY (char *) 0, " " /* XXX Bogus? */
49 #define DSB_DTYPE_NONE ((char *) 0)
50 #define DSB_DTYPE_SMTP "smtp" /* RFC 2821 */
51 #define DSB_DTYPE_UNIX "x-unix" /* sysexits.h */
52 #define DSB_DTYPE_SASL "x-sasl" /* libsasl */
54 extern DSN_BUF
*dsb_create(void);
55 extern DSN_BUF
*PRINTFLIKE(8, 9) dsb_update(DSN_BUF
*, const char *, const char *, const char *, const char *, const char *, const char *, const char *,...);
56 extern DSN_BUF
*PRINTFLIKE(3, 4) dsb_simple(DSN_BUF
*, const char *, const char *,...);
57 extern DSN_BUF
*PRINTFLIKE(4, 5) dsb_unix(DSN_BUF
*, const char *, const char *, const char *,...);
58 extern DSN_BUF
*dsb_formal(DSN_BUF
*, const char *, const char *, const char *, const char *, const char *, const char *);
59 extern DSN_BUF
*dsb_status(DSN_BUF
*, const char *);
60 extern void dsb_reset(DSN_BUF
*);
61 extern void dsb_free(DSN_BUF
*);
64 * Early implementations of the DSN structure represented unavailable
65 * information with null pointers. This resulted in hard to maintain code.
66 * We now use empty strings instead, so there is no need anymore to convert
67 * empty strings to null pointers in the macro below.
69 #define DSN_FROM_DSN_BUF(dsb) \
70 DSN_ASSIGN(&(dsb)->dsn, \
71 vstring_str((dsb)->status), \
72 vstring_str((dsb)->action), \
73 vstring_str((dsb)->reason), \
74 vstring_str((dsb)->dtype), \
75 vstring_str((dsb)->dtext), \
76 vstring_str((dsb)->mtype), \
77 vstring_str((dsb)->mname))
82 /* The Secure Mailer license must be distributed with this software.
85 /* IBM T.J. Watson Research
87 /* Yorktown Heights, NY 10598, USA