X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fspool_out.c;h=ebe089d4f656f8439a833bdb0c0cecb4bb0a8b54;hb=f1f7d0cddd4fb38d0bcf81be13d6e272789ff9c7;hp=82b606871d225bd9a7ebb66ba2c7bf4a3fcd70ee;hpb=41313d92e0f157dacfa758993e7fc76e291b0415;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/spool_out.c b/src/src/spool_out.c index 82b606871..ebe089d4f 100644 --- a/src/src/spool_out.c +++ b/src/src/spool_out.c @@ -17,7 +17,7 @@ *************************************************/ /* This function is called immediately after errors in writing the spool, with -errno still set. It creates and error message, depending on the circumstances. +errno still set. It creates an error message, depending on the circumstances. If errmsg is NULL, it logs the message and panic-dies. Otherwise errmsg is set to point to the message, and -1 is returned. This function makes the code of spool_write_header() a bit neater. @@ -36,22 +36,21 @@ static int spool_write_error(int where, uschar **errmsg, uschar *s, uschar *temp_name, FILE *f) { -uschar *msg = (where == SW_RECEIVING)? - string_sprintf("spool file %s error while receiving from %s: %s", s, - (sender_fullhost != NULL)? sender_fullhost : sender_ident, - strerror(errno)) - : - string_sprintf("spool file %s error while %s: %s", s, - (where == SW_DELIVERING)? "delivering" : "modifying", - strerror(errno)); - -if (temp_name != NULL) Uunlink(temp_name); -if (f != NULL) (void)fclose(f); - -if (errmsg == NULL) - log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s", msg); -else +uschar *msg = where == SW_RECEIVING + ? string_sprintf("spool file %s error while receiving from %s: %s", s, + sender_fullhost ? sender_fullhost : sender_ident, + strerror(errno)) + : string_sprintf("spool file %s error while %s: %s", s, + where == SW_DELIVERING ? "delivering" : "modifying", + strerror(errno)); + +if (temp_name) Uunlink(temp_name); +if (f) (void)fclose(f); + +if (errmsg) *errmsg = msg; +else + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s", msg); return -1; } @@ -198,7 +197,10 @@ tree_walk(acl_var_m, &acl_var_write, f); /* Now any other data that needs to be remembered. */ -fprintf(f, "-body_linecount %d\n", body_linecount); +if (spool_file_wireformat) + fprintf(f, "-spool_file_wireformat\n"); +else + fprintf(f, "-body_linecount %d\n", body_linecount); fprintf(f, "-max_received_linelength %d\n", max_received_linelength); if (body_zerocount > 0) fprintf(f, "-body_zerocount %d\n", body_zerocount); @@ -379,7 +381,7 @@ if (close(fd) < 0) #endif /* NEED_SYNC_DIRECTORY */ /* Return the number of characters in the headers, which is the file size, less -the prelimary stuff, less the additional count fields on the headers. */ +the preliminary stuff, less the additional count fields on the headers. */ DEBUG(D_receive) debug_printf("Size of headers = %d\n", (int)(statbuf.st_size - size_correction));