81 #define STR vstring_str
86 char *queue_id,
char *encoding,
87 int smtputf8,
char *recipient,
88 char *dsn_envid,
int dsn_ret,
92 int bounce_status = 1;
93 int postmaster_status = 1;
134 encoding, smtputf8, dsn_envid,
137 #define NULL_SENDER MAIL_ADDR_EMPTY
138 #define NULL_TRACE_FLAGS 0
161 msg_warn(
"%s: undeliverable postmaster notification discarded",
170 #define ANY_BOUNCE (MAIL_ERROR_2BOUNCE | MAIL_ERROR_BOUNCE)
171 #define SEND_POSTMASTER_ANY_BOUNCE_NOTICE (notify_mask & ANY_BOUNCE)
173 else if (*recipient == 0) {
201 if (bounce_status == 0)
202 msg_info(
"%s: postmaster non-delivery notification: %s",
203 queue_id,
STR(new_id));
242 if (bounce_status == 0)
243 msg_info(
"%s: sender non-delivery notification: %s",
244 queue_id,
STR(new_id));
260 #define SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE (notify_mask & MAIL_ERROR_BOUNCE)
289 if (postmaster_status == 0)
290 msg_info(
"%s: postmaster non-delivery notification: %s",
291 queue_id,
STR(new_id));
296 postmaster_status = 0;
299 if (postmaster_status)
300 msg_warn(
"%s: postmaster notice failed while bouncing to %s",
301 queue_id, recipient);
318 msg_fatal(
"remove %s %s: %m", service, queue_id);
326 return (bounce_status);
#define SEND_POSTMASTER_ANY_BOUNCE_NOTICE
int bounce_notify_service(int flags, char *service, char *queue_name, char *queue_id, char *encoding, int smtputf8, char *recipient, char *dsn_envid, int dsn_ret, BOUNCE_TEMPLATES *ts)
int bounce_original(VSTREAM *bounce, BOUNCE_INFO *bounce_info, int headers_only)
#define DSN_NOTIFY_OVERRIDE
#define DSN_NOTIFY_FAILURE
int bounce_header(VSTREAM *bounce, BOUNCE_INFO *bounce_info, const char *dest, int postmaster_copy)
#define SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE
const NAME_MASK mail_error_masks[]
#define strcasecmp_utf8(s1, s2)
int bounce_diagnostic_dsn(VSTREAM *bounce, BOUNCE_INFO *bounce_info, int notify_filter)
VSTREAM * post_mail_fopen_nowait(const char *sender, const char *recipient, int source_class, int trace_flags, int utf8_flags, VSTRING *queue_id)
char * var_notify_classes
int vstream_fclose(VSTREAM *stream)
#define MAIL_SRC_MASK_BOUNCE
void msg_warn(const char *fmt,...)
VSTRING * vstring_alloc(ssize_t len)
int post_mail_fclose(VSTREAM *cleanup)
#define name_mask(tag, table, str)
int bounce_boilerplate(VSTREAM *bounce, BOUNCE_INFO *bounce_info)
NORETURN msg_fatal(const char *fmt,...)
int bounce_diagnostic_log(VSTREAM *bounce, BOUNCE_INFO *bounce_info, int notify_filter)
#define VAR_NOTIFY_CLASSES
const char * mail_addr_double_bounce(void)
int mail_queue_remove(const char *queue_name, const char *queue_id)
#define NO_POSTMASTER_COPY
BOUNCE_INFO * bounce_mail_init(const char *service, const char *queue_name, const char *queue_id, const char *encoding, int smtputf8, const char *dsn_envid, BOUNCE_TEMPLATE *template)
VSTRING * vstring_free(VSTRING *vp)
BOUNCE_TEMPLATE * failure
void bounce_mail_free(BOUNCE_INFO *bounce_info)
int bounce_header_dsn(VSTREAM *bounce, BOUNCE_INFO *bounce_info)
#define BOUNCE_FLAG_DELRCPT
void msg_info(const char *fmt,...)
void bounce_delrcpt(BOUNCE_INFO *bounce_info)