95 static const char *def_bounce_failure_body[] = {
96 "This is the mail system at host $myhostname.",
98 "I'm sorry to have to inform you that your message could not",
99 "be delivered to one or more recipients. It's attached below.",
103 "If you do so, please include this problem report. You can",
104 "delete your own text from the attached returned message.",
117 "Undelivered Mail Returned to Sender",
118 "Postmaster Copy: Undelivered Mail",
119 def_bounce_failure_body,
120 &def_bounce_failure_template,
126 static const char *def_bounce_delay_body[] = {
127 "This is the mail system at host $myhostname.",
129 "####################################################################",
130 "# THIS IS A WARNING ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. #",
131 "####################################################################",
133 "Your message could not be delivered for more than $delay_warning_time_hours hour(s)."
135 "It will be retried until it is $maximal_queue_lifetime_days day(s) old.",
139 "If you do so, please include this problem report. You can",
140 "delete your own text from the attached returned message.",
153 "Delayed Mail (still being retried)",
154 "Postmaster Warning: Delayed Mail",
155 def_bounce_delay_body,
156 &def_bounce_delay_template
163 static const char *def_bounce_success_body[] = {
164 "This is the mail system at host $myhostname.",
166 "Your message was successfully delivered to the destination(s)",
167 "listed below. If the message was delivered to mailbox you will",
168 "receive no further notifications. Otherwise you may still receive",
169 "notifications of mail delivery errors from other systems.",
182 "Successful Mail Delivery Report",
184 def_bounce_success_body,
185 &def_bounce_success_template,
192 static const char *def_bounce_verify_body[] = {
193 "This is the mail system at host $myhostname.",
195 "Enclosed is the mail delivery report that you requested.",
208 "Mail Delivery Status Report",
210 def_bounce_verify_body,
211 &def_bounce_verify_template,
217 #define STR(x) vstring_str(x)
251 VSTRING *saved_member_name = 0;
268 cp =
STR(line_buf) + strspn(
STR(line_buf),
" \t\n\v\f\r");
269 if (*cp == 0 || *cp ==
'#')
274 if (value[0] ==
'<' && value[1] ==
'<') {
279 msg_fatal(
"%s, line %d: missing end marker after <<",
282 msg_fatal(
"%s, line %d: malformed end marker after <<",
284 if (multi_line_buf == 0) {
294 if (strcmp(
STR(line_buf),
STR(saved_end_marker)) == 0)
301 msg_warn(
"%s, line %d: missing \"%s\" end marker",
303 member_name =
STR(saved_member_name);
304 value =
STR(multi_line_buf);
306 #define MATCH_TMPL_NAME(tname, tname_len, mname) \
307 (strncmp(tname, mname, tname_len = strlen(tname)) == 0 \
308 && strcmp(mname + tname_len, "_template") == 0)
319 msg_warn(
"%s, line %d: unknown template name: %s "
320 "-- ignoring this template",
324 if (multi_line_buf) {
333 static int bounce_plain_out(
VSTREAM *fp,
const char *text)
#define MAIL_ADDR_POSTMASTER
int vstring_get_nonl(VSTRING *vp, VSTREAM *fp)
#define BOUNCE_TMPL_CLASS_SUCCESS
void bounce_templates_dump(VSTREAM *fp, BOUNCE_TEMPLATES *ts)
#define BOUNCE_TMPL_CLASS_DELAY
void bounce_template_free(BOUNCE_TEMPLATE *tp)
const char * split_nameval(char *buf, char **name, char **value)
VSTRING * vstring_strcpy(VSTRING *vp, const char *src)
VSTREAM * vstream_fprintf(VSTREAM *stream, const char *fmt,...)
BOUNCE_TEMPLATES * bounce_templates_create(void)
#define VSTRING_RESET(vp)
#define MAIL_ADDR_MAIL_DAEMON
void msg_warn(const char *fmt,...)
#define BOUNCE_TMPL_CLASS_FAILURE
VSTRING * vstring_alloc(ssize_t len)
BOUNCE_TEMPLATE * success
void bounce_template_expand(BOUNCE_XP_PUT_FN out_fn, VSTREAM *fp, BOUNCE_TEMPLATE *tp)
BOUNCE_TEMPLATE * bounce_template_create(const BOUNCE_TEMPLATE *prototype)
NORETURN msg_fatal(const char *fmt,...)
void bounce_templates_expand(VSTREAM *fp, BOUNCE_TEMPLATES *ts)
void bounce_templates_free(BOUNCE_TEMPLATES *bs)
void bounce_templates_load(VSTREAM *fp, BOUNCE_TEMPLATES *ts)
VSTRING * vstring_free(VSTRING *vp)
#define BOUNCE_TMPL_CLASS_VERIFY
BOUNCE_TEMPLATE * failure
VSTRING * vstring_strcat(VSTRING *vp, const char *src)
void bounce_template_dump(VSTREAM *fp, BOUNCE_TEMPLATE *tp)
void bounce_template_load(BOUNCE_TEMPLATE *tp, const char *origin, const char *buffer)
#define MATCH_TMPL_NAME(tname, tname_len, mname)
#define MAIL_ATTR_ENC_7BIT
void * mymalloc(ssize_t len)