Postfix3.3.1
bounce_template.h
[詳解]
1 #ifndef _BOUNCE_TEMPLATE_H_INCLUDED_
2 #define _BOUNCE_TEMPLATE_H_INCLUDED_
3 
4 /*++
5 /* NAME
6 /* bounce_template 3h
7 /* SUMMARY
8 /* bounce template support
9 /* SYNOPSIS
10 /* #include <bounce_template.h>
11 /* DESCRIPTION
12 /* .nf
13 
14  /*
15  * Utility library.
16  */
17 #include <vstream.h>
18 
19  /*
20  * Structure of a single bounce template. Each template is manipulated by
21  * itself, without any external markers and delimiters. Applications are not
22  * supposed to access BOUNCE_TEMPLATE attributes directly.
23  */
24 typedef struct BOUNCE_TEMPLATE {
25  int flags;
26  const char *class; /* for diagnostics (fixed) */
27  const char *origin; /* built-in or pathname */
28  const char *mime_charset; /* character set (configurable) */
29  const char *mime_encoding; /* 7bit or 8bit (derived) */
30  const char *from; /* originator (configurable) */
31  const char *subject; /* general subject (configurable) */
32  const char *postmaster_subject; /* postmaster subject (configurable) */
33  const char **message_text; /* message text (configurable) */
34  const struct BOUNCE_TEMPLATE *prototype; /* defaults */
35  char *buffer; /* ripped text */
37 
38 #define BOUNCE_TMPL_FLAG_NEW_BUFFER (1<<0)
39 
40 #define BOUNCE_TMPL_CLASS_FAILURE "failure"
41 #define BOUNCE_TMPL_CLASS_DELAY "delay"
42 #define BOUNCE_TMPL_CLASS_SUCCESS "success"
43 #define BOUNCE_TMPL_CLASS_VERIFY "verify"
44 
45 #define IS_FAILURE_TEMPLATE(t) ((t)->class[0] == BOUNCE_TMPL_CLASS_FAILURE[0])
46 #define IS_DELAY_TEMPLATE(t) ((t)->class[0] == BOUNCE_TMPL_CLASS_DELAY[0])
47 #define IS_SUCCESS_TEMPLATE(t) ((t)->class[0] == BOUNCE_TMPL_CLASS_SUCCESS[0])
48 #define IS_VERIFY_TEMPLATE(t) ((t)->class[0] == BOUNCE_TMPL_CLASS_verify[0])
49 
50 #define bounce_template_encoding(t) ((t)->mime_encoding)
51 #define bounce_template_charset(t) ((t)->mime_charset)
52 
53 typedef int PRINTFPTRLIKE(2, 3) (*BOUNCE_XP_PRN_FN) (VSTREAM *, const char *,...);
54 typedef int (*BOUNCE_XP_PUT_FN) (VSTREAM *, const char *);
55 
58 extern void bounce_template_load(BOUNCE_TEMPLATE *, const char *, const char *);
59 extern void bounce_template_headers(BOUNCE_XP_PRN_FN, VSTREAM *, BOUNCE_TEMPLATE *, const char *, int);
62 
63 #define POSTMASTER_COPY 1 /* postmaster copy */
64 #define NO_POSTMASTER_COPY 0 /* not postmaster copy */
65 
66  /*
67  * Structure of a bounce template collection. These templates are read and
68  * written in their external representation, with markers and delimiters.
69  */
70 typedef struct {
76 
82 
83 /* LICENSE
84 /* .ad
85 /* .fi
86 /* The Secure Mailer license must be distributed with this software.
87 /* AUTHOR(S)
88 /* Wietse Venema
89 /* IBM T.J. Watson Research
90 /* P.O. Box 704
91 /* Yorktown Heights, NY 10598, USA
92 /*--*/
93 
94 #endif
void bounce_templates_free(BOUNCE_TEMPLATES *)
const char * mime_charset
BOUNCE_TEMPLATE * verify
int PRINTFPTRLIKE(2, 3)(*BOUNCE_XP_PRN_FN)(VSTREAM *
void bounce_template_free(BOUNCE_TEMPLATE *)
const struct BOUNCE_TEMPLATE * prototype
const char * subject
void bounce_templates_expand(VSTREAM *, BOUNCE_TEMPLATES *)
const char ** message_text
BOUNCE_TEMPLATE * success
void bounce_template_expand(BOUNCE_XP_PUT_FN, VSTREAM *, BOUNCE_TEMPLATE *)
BOUNCE_TEMPLATES * bounce_templates_create(void)
int int
Definition: smtpd_proxy.h:21
const char * mime_encoding
const char * origin
struct BOUNCE_TEMPLATE BOUNCE_TEMPLATE
const char * from
void bounce_template_headers(BOUNCE_XP_PRN_FN, VSTREAM *, BOUNCE_TEMPLATE *, const char *, int)
BOUNCE_TEMPLATE * failure
void bounce_templates_dump(VSTREAM *, BOUNCE_TEMPLATES *)
void bounce_templates_load(VSTREAM *, BOUNCE_TEMPLATES *)
int const char typedef int(* BOUNCE_XP_PUT_FN)(VSTREAM *, const char *)
BOUNCE_TEMPLATE * bounce_template_create(const BOUNCE_TEMPLATE *)
void bounce_template_dump(VSTREAM *, BOUNCE_TEMPLATE *)
void bounce_template_load(BOUNCE_TEMPLATE *, const char *, const char *)
BOUNCE_TEMPLATE * delay
const char * postmaster_subject