132
133
DELIVER_REQUEST *request = state->request;
133
134
SMTP_SESSION *session = state->session;
134
135
DSN_BUF *why = state->why;
136
const char *dsn_action = "relayed";
140
* Assume this was intermediate delivery when the server announced DSN
141
* support, and don't send a DSN "SUCCESS" notification.
143
if (session->features & SMTP_FEATURE_DSN)
144
rcpt->dsn_notify &= ~DSN_NOTIFY_SUCCESS;
147
* Assume this was final delivery when the LMTP server announced no DSN
148
* support. In backwards compatibility mode, send a "relayed" instead of
149
* a "delivered" DSN "SUCCESS" notification. Do not attempt to "simplify"
150
* the expression. The redundancy is for clarity. It is trivially
151
* eliminated by the compiler. There is no need to sacrifice clarity for
152
* the sake of "performance".
154
if ((session->features & SMTP_FEATURE_DSN) == 0
155
&& (state->misc_flags & SMTP_MISC_FLAG_USE_LMTP) != 0
156
&& var_lmtp_assume_final != 0)
157
dsn_action = "delivered";
138
160
* Report success and delete the recipient from the delivery request.
139
* Defer if the success can't be reported. Don't send a DSN "SUCCESS"
140
* notification if the receiving site announced DSN support.
161
* Defer if the success can't be reported.
142
163
* Note: the DSN action is ignored in case of address probes.
144
if (session->features & SMTP_FEATURE_DSN)
145
rcpt->dsn_notify &= ~DSN_NOTIFY_SUCCESS;
147
dsb_update(why, resp->dsn, "relayed", DSB_MTYPE_DNS, session->host,
165
dsb_update(why, resp->dsn, dsn_action, DSB_MTYPE_DNS, session->host,
148
166
DSB_DTYPE_SMTP, resp->str, "%s", resp->str);
150
168
status = sent(DEL_REQ_TRACE_FLAGS(request->flags),