84 #define STR vstring_str
89 char *queue_id,
char *encoding,
90 int smtputf8,
char *recipient,
91 char *dsn_envid,
int dsn_ret,
94 const char *myname =
"bounce_notify_verp";
96 int bounce_status = 0;
97 int postmaster_status;
110 msg_panic(
"%s: attempt to bounce a single bounce", myname);
112 msg_panic(
"%s: attempt to bounce a double bounce", myname);
118 encoding, smtputf8, dsn_envid,
129 dsb_simple(dsn_buf,
"5.0.0",
"(error report unavailable)");
134 encoding, smtputf8, recipient,
135 dsn_envid, dsn_ret, rcpt_buf,
140 return (bounce_status);
142 #define NULL_SENDER MAIL_ADDR_EMPTY
143 #define NULL_TRACE_FLAGS 0
165 verp_sender(verp_buf, verp_delims, recipient, rcpt);
186 if (bounce_status == 0)
187 msg_info(
"%s: sender non-delivery notification: %s",
188 queue_id,
STR(new_id));
196 if (bounce_status != 0)
213 #define SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE (notify_mask & MAIL_ERROR_BOUNCE)
238 if (postmaster_status == 0)
239 msg_info(
"%s: postmaster non-delivery notification: %s",
240 queue_id,
STR(new_id));
242 postmaster_status = 1;
244 if (postmaster_status)
245 msg_warn(
"%s: postmaster notice failed while bouncing to %s",
246 queue_id, recipient);
257 msg_fatal(
"remove %s %s: %m", service, queue_id);
266 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)
DSN_BUF * dsb_create(void)
int bounce_original(VSTREAM *bounce, BOUNCE_INFO *bounce_info, int headers_only)
NORETURN msg_panic(const char *fmt,...)
#define DSN_NOTIFY_FAILURE
int bounce_header(VSTREAM *bounce, BOUNCE_INFO *bounce_info, const char *dest, int postmaster_copy)
VSTRING * verp_sender(VSTRING *buf, const char *delimiters, const char *sender, const RECIPIENT *rcpt_info)
#define SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE
void dsb_free(DSN_BUF *dsb)
const NAME_MASK mail_error_masks[]
#define strcasecmp_utf8(s1, s2)
VSTRING * vstring_strcpy(VSTRING *vp, const char *src)
RCPT_BUF * rcpb_create(void)
VSTREAM * post_mail_fopen_nowait(const char *sender, const char *recipient, int source_class, int trace_flags, int utf8_flags, VSTRING *queue_id)
int bounce_notify_verp(int flags, char *service, char *queue_name, char *queue_id, char *encoding, int smtputf8, char *recipient, char *dsn_envid, int dsn_ret, char *verp_delims, BOUNCE_TEMPLATES *ts)
void rcpb_free(RCPT_BUF *rcpt)
#define DSN_FROM_DSN_BUF(dsb)
char * var_notify_classes
#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)
DSN_BUF * dsb_simple(DSN_BUF *dsb, const char *status, const char *format,...)
NORETURN msg_fatal(const char *fmt,...)
#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
#define RECIPIENT_FROM_RCPT_BUF(buf)
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)
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)
int bounce_header_dsn(VSTREAM *bounce, BOUNCE_INFO *bounce_info)
#define BOUNCE_FLAG_DELRCPT
void bounce_delrcpt_one(BOUNCE_INFO *bounce_info)
BOUNCE_LOG * bounce_log_read(BOUNCE_LOG *bp, RCPT_BUF *rcpt_buf, DSN_BUF *dsn_buf)
void msg_info(const char *fmt,...)