81 #define STR vstring_str
86 char *encoding,
int smtputf8,
87 char *orig_sender,
char *dsn_envid,
92 int bounce_status = 1;
93 int postmaster_status = 1;
103 smtputf8, dsn_envid, rcpt_buf,
106 #define NULL_SENDER MAIL_ADDR_EMPTY
107 #define NULL_TRACE_FLAGS 0
131 msg_warn(
"%s: undeliverable postmaster notification discarded",
140 #define ANY_BOUNCE (MAIL_ERROR_2BOUNCE | MAIL_ERROR_BOUNCE)
141 #define SEND_POSTMASTER_ANY_BOUNCE_NOTICE (notify_mask & ANY_BOUNCE)
143 else if (*orig_sender == 0) {
167 if (bounce_status == 0)
168 msg_info(
"%s: postmaster non-delivery notification: %s",
169 queue_id,
STR(new_id));
205 if (bounce_status == 0)
206 msg_info(
"%s: sender non-delivery notification: %s",
207 queue_id,
STR(new_id));
218 #define SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE (notify_mask & MAIL_ERROR_BOUNCE)
243 if (postmaster_status == 0)
244 msg_info(
"%s: postmaster non-delivery notification: %s",
245 queue_id,
STR(new_id));
247 if (postmaster_status)
248 msg_warn(
"%s: postmaster notice failed while bouncing to %s",
249 queue_id, orig_sender);
265 return (bounce_status);
int bounce_one_service(int flags, char *queue_name, char *queue_id, char *encoding, int smtputf8, char *orig_sender, char *dsn_envid, int dsn_ret, RCPT_BUF *rcpt_buf, DSN_BUF *dsn_buf, BOUNCE_TEMPLATES *ts)
int bounce_original(VSTREAM *bounce, BOUNCE_INFO *bounce_info, int headers_only)
#define DSN_NOTIFY_FAILURE
int bounce_header(VSTREAM *bounce, BOUNCE_INFO *bounce_info, const char *dest, int postmaster_copy)
const NAME_MASK mail_error_masks[]
#define strcasecmp_utf8(s1, s2)
VSTREAM * post_mail_fopen_nowait(const char *sender, const char *recipient, int source_class, int trace_flags, int utf8_flags, VSTRING *queue_id)
#define SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE
char * var_notify_classes
#define SEND_POSTMASTER_ANY_BOUNCE_NOTICE
#define MAIL_SRC_MASK_BOUNCE
void msg_warn(const char *fmt,...)
VSTRING * vstring_alloc(ssize_t len)
int bounce_recipient_log(VSTREAM *bounce, BOUNCE_INFO *bounce_info)
int post_mail_fclose(VSTREAM *cleanup)
#define name_mask(tag, table, str)
int bounce_boilerplate(VSTREAM *bounce, BOUNCE_INFO *bounce_info)
#define VAR_NOTIFY_CLASSES
const char * mail_addr_double_bounce(void)
#define NO_POSTMASTER_COPY
int bounce_recipient_dsn(VSTREAM *bounce, BOUNCE_INFO *bounce_info)
VSTRING * vstring_free(VSTRING *vp)
BOUNCE_TEMPLATE * failure
void bounce_mail_free(BOUNCE_INFO *bounce_info)
BOUNCE_INFO * bounce_mail_one_init(const char *queue_name, const char *queue_id, const char *encoding, int smtputf8, const char *dsn_envid, RCPT_BUF *rcpt_buf, DSN_BUF *dsn_buf, BOUNCE_TEMPLATE *template)
int bounce_header_dsn(VSTREAM *bounce, BOUNCE_INFO *bounce_info)
#define BOUNCE_FLAG_DELRCPT
void bounce_delrcpt_one(BOUNCE_INFO *bounce_info)
void msg_info(const char *fmt,...)