*/
void
-receive_add_recipient(uschar *recipient, int pno)
+receive_add_recipient(uschar * recipient, int pno)
{
if (recipients_count >= recipients_list_max)
{
that this has happened, in order to give a better error if there are
no recipients left. */
- else if (recipient != NULL)
+ else if (recipient)
{
if (tree_search(tree_nonrecipients, recipient) == NULL)
receive_add_recipient(recipient, -1);
/* Move on past this address */
- s = ss + (*ss? 1:0);
+ s = ss + (*ss ? 1 : 0);
while (isspace(*s)) s++;
} /* Next address */
if (rc == LOCAL_SCAN_ACCEPT)
{
if (local_scan_data)
- for (uschar * s = local_scan_data; *s != 0; s++) if (*s == '\n') *s = ' ';
- for (int i = 0; i < recipients_count; i++)
+ for (uschar * s = local_scan_data; *s; s++) if (*s == '\n') *s = ' ';
+ for (recipient_item * r = recipients_list;
+ r < recipients_list + recipients_count; r++)
{
- recipient_item *r = recipients_list + i;
r->address = rewrite_address_qualify(r->address, TRUE);
if (r->errors_to)
r->errors_to = rewrite_address_qualify(r->errors_to, TRUE);
signal(SIGINT, SIG_IGN);
#endif /* HAVE_LOCAL_SCAN */
+/* If we are faking a reject or defer, avoid sennding a DSN for the
+actually-accepted message */
+
+if (fake_response != OK)
+ for (recipient_item * r = recipients_list;
+ r < recipients_list + recipients_count; r++)
+ {
+ DEBUG(D_receive) if (r->dsn_flags & (rf_notify_success | rf_notify_delay))
+ debug_printf("DSN: clearing flags due to fake-response for message\n");
+ r->dsn_flags = r->dsn_flags & ~(rf_notify_success | rf_notify_delay)
+ | rf_notify_never;
+ }
+
/* Ensure the first time flag is set in the newly-received message. */