X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/0cbf2b821bb13da0268556d0e30ea627d5592c60..468c0c7e3066886ff5028bb423b96712a155fe05:/src/src/deliver.c diff --git a/src/src/deliver.c b/src/src/deliver.c index d85f010e6..e588ee4a4 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -1085,9 +1085,7 @@ if (addr->message) ) && ( Ustrstr(s, "mysql") != NULL || Ustrstr(s, "pgsql") != NULL -#ifdef EXPERIMENTAL_REDIS || Ustrstr(s, "redis") != NULL -#endif || Ustrstr(s, "sqlite") != NULL || Ustrstr(s, "ldap:") != NULL || Ustrstr(s, "ldapdn:") != NULL @@ -6842,16 +6840,13 @@ prevents actual delivery. */ else if (!dont_deliver) retry_update(&addr_defer, &addr_failed, &addr_succeed); -/* Send DSN for successful messages */ -addr_dsntmp = addr_succeed; +/* Send DSN for successful messages if requested */ addr_senddsn = NULL; -while(addr_dsntmp) +for (addr_dsntmp = addr_succeed; addr_dsntmp; addr_dsntmp = addr_dsntmp->next) { /* af_ignore_error not honored here. it's not an error */ - DEBUG(D_deliver) - { - debug_printf("DSN: processing router : %s\n" + DEBUG(D_deliver) debug_printf("DSN: processing router : %s\n" "DSN: processing successful delivery address: %s\n" "DSN: Sender_address: %s\n" "DSN: orcpt: %s flags: %d\n" @@ -6866,7 +6861,6 @@ while(addr_dsntmp) addr_dsntmp->address, addr_dsntmp->dsn_aware ); - } /* send report if next hop not DSN aware or a router flagged "last DSN hop" and a report was requested */ @@ -6886,8 +6880,6 @@ while(addr_dsntmp) } else DEBUG(D_deliver) debug_printf("DSN: not sending DSN success message\n"); - - addr_dsntmp = addr_dsntmp->next; } if (addr_senddsn) @@ -7409,6 +7401,9 @@ wording. */ if (dsn_ret == dsn_ret_hdrs) topt |= topt_no_body; else + { + struct stat statbuf; + /* no full body return at all? */ if (!bounce_return_body) { @@ -7417,16 +7412,18 @@ wording. */ if (dsn_ret == dsn_ret_full) dsnnotifyhdr = dsnlimitmsg; } + /* line length limited... return headers only if oversize */ /* size limited ... return headers only if limit reached */ - else if (bounce_return_size_limit > 0) - { - struct stat statbuf; - if (fstat(deliver_datafile, &statbuf) == 0 && statbuf.st_size > max) - { - topt |= topt_no_body; - dsnnotifyhdr = dsnlimitmsg; - } + else if ( max_received_linelength > bounce_return_linesize_limit + || ( bounce_return_size_limit > 0 + && fstat(deliver_datafile, &statbuf) == 0 + && statbuf.st_size > max + ) ) + { + topt |= topt_no_body; + dsnnotifyhdr = dsnlimitmsg; } + } #ifdef SUPPORT_I18N if (message_smtputf8) @@ -7756,6 +7753,7 @@ else if (addr_defer != (address_item *)(+1)) FILE *wmf = NULL; FILE *f = fdopen(fd, "wb"); uschar * bound; + int topt; if (warn_message_file) if (!(wmf = Ufopen(warn_message_file, "rb"))) @@ -7902,7 +7900,7 @@ else if (addr_defer != (address_item *)(+1)) fflush(f); /* header only as required by RFC. only failure DSN needs to honor RET=FULL */ - int topt = topt_add_return_path | topt_no_body; + topt = topt_add_return_path | topt_no_body; transport_filter_argv = NULL; /* Just in case */ return_path = sender_address; /* In case not previously set */ /* Write the original email out */