X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fdeliver.c;h=202f7a400a3e40e783359907537eda158538a9a8;hb=803628d5b0b175dfa78f0b19b35213ace01207b1;hp=0a8d7000251d6a3ddb88ca991bb3f58dfdd1325d;hpb=41313d92e0f157dacfa758993e7fc76e291b0415;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/deliver.c b/src/src/deliver.c index 0a8d70002..202f7a400 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -708,25 +708,31 @@ return s; static uschar * -d_hostlog(uschar *s, int *sizep, int *ptrp, address_item *addr) +d_hostlog(uschar * s, int * sp, int * pp, address_item * addr) { -s = string_append(s, sizep, ptrp, 5, US" H=", addr->host_used->name, - US" [", addr->host_used->address, US"]"); +host_item * h = addr->host_used; + +s = string_append(s, sp, pp, 2, US" H=", h->name); + +if (LOGGING(dnssec) && h->dnssec == DS_YES) + s = string_cat(s, sp, pp, US" DS"); + +s = string_append(s, sp, pp, 3, US" [", h->address, US"]"); + if (LOGGING(outgoing_port)) - s = string_append(s, sizep, ptrp, 2, US":", string_sprintf("%d", - addr->host_used->port)); + s = string_append(s, sp, pp, 2, US":", string_sprintf("%d", h->port)); #ifdef SUPPORT_SOCKS if (LOGGING(proxy) && proxy_local_address) { - s = string_append(s, sizep, ptrp, 3, US" PRX=[", proxy_local_address, US"]"); + s = string_append(s, sp, pp, 3, US" PRX=[", proxy_local_address, US"]"); if (LOGGING(outgoing_port)) - s = string_append(s, sizep, ptrp, 2, US":", string_sprintf("%d", + s = string_append(s, sp, pp, 2, US":", string_sprintf("%d", proxy_local_port)); } #endif -return d_log_interface(s, sizep, ptrp); +return d_log_interface(s, sp, pp); } @@ -4716,13 +4722,17 @@ Returns: OK */ int -deliver_split_address(address_item *addr) +deliver_split_address(address_item * addr) { -uschar *address = addr->address; -uschar *domain = Ustrrchr(address, '@'); -uschar *t; -int len = domain - address; +uschar * address = addr->address; +uschar * domain; +uschar * t; +int len; + +if (!(domain = Ustrrchr(address, '@'))) + return DEFER; /* should always have a domain, but just in case... */ +len = domain - address; addr->domain = string_copylc(domain+1); /* Domains are always caseless */ /* The implication in the RFCs (though I can't say I've seen it spelled out @@ -4734,7 +4744,7 @@ removing quoting backslashes and any unquoted doublequotes. */ t = addr->cc_local_part = store_get(len+1); while(len-- > 0) { - register int c = *address++; + int c = *address++; if (c == '\"') continue; if (c == '\\') { @@ -6896,8 +6906,8 @@ if (addr_senddsn) { FILE *f = fdopen(fd, "wb"); /* header only as required by RFC. only failure DSN needs to honor RET=FULL */ - int topt = topt_add_return_path | topt_no_body; uschar * bound; + transport_ctx tctx; DEBUG(D_deliver) debug_printf("sending error message to: %s\n", sender_address); @@ -6976,7 +6986,10 @@ if (addr_senddsn) return_path = sender_address; /* In case not previously set */ /* Write the original email out */ - transport_write_message(NULL, fileno(f), topt, 0, NULL, NULL, NULL, NULL, NULL, 0); + + bzero(&tctx, sizeof(tctx)); + tctx.options = topt_add_return_path | topt_no_body; + transport_write_message(fileno(f), &tctx, 0); fflush(f); fprintf(f,"\n--%s--\n", bound); @@ -7431,8 +7444,18 @@ wording. */ fflush(f); transport_filter_argv = NULL; /* Just in case */ return_path = sender_address; /* In case not previously set */ - transport_write_message(NULL, fileno(f), topt, - 0, dsnnotifyhdr, NULL, NULL, NULL, NULL, 0); + { /* Dummy transport for headers add */ + transport_ctx * tctx = + store_get(sizeof(*tctx) + sizeof(transport_instance)); + transport_instance * tb = (transport_instance *)(tctx+1); + + bzero(tctx, sizeof(*tctx)+sizeof(*tb)); + tctx->tblock = tb; + tctx->options = topt; + tb->add_headers = dsnnotifyhdr; + + transport_write_message(fileno(f), tctx, 0); + } fflush(f); /* we never add the final text. close the file */ @@ -7748,7 +7771,9 @@ else if (addr_defer != (address_item *)(+1)) FILE *wmf = NULL; FILE *f = fdopen(fd, "wb"); uschar * bound; - int topt; + transport_ctx tctx; + + bzero(&tctx, sizeof(tctx)); if (warn_message_file) if (!(wmf = Ufopen(warn_message_file, "rb"))) @@ -7895,11 +7920,12 @@ else if (addr_defer != (address_item *)(+1)) fflush(f); /* header only as required by RFC. only failure DSN needs to honor RET=FULL */ - topt = topt_add_return_path | topt_no_body; + tctx.options = 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 */ - transport_write_message(NULL, fileno(f), topt, 0, NULL, NULL, NULL, NULL, NULL, 0); + transport_write_message(fileno(f), &tctx, 0); fflush(f); fprintf(f,"\n--%s--\n", bound);