Commit bb957397 bb957397c13ca9f7df29ede24d5eac4d3e3800a1 by Sergey Poznyakoff

Test if environment variable MTA_APPEND is set.

1 parent 5e303a63
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
40 is "localhost". 40 is "localhost".
41 MTA_DIAG Sets the name of the output diagnostic file. By default, 41 MTA_DIAG Sets the name of the output diagnostic file. By default,
42 the diagnostics goes to stderr. 42 the diagnostics goes to stderr.
43 MTA_APPEND When set to any non-empty value, directs mta to append
44 to the diagnostics file, not to overwrite it.
43 45
44 */ 46 */
45 47
...@@ -130,7 +132,8 @@ main (int argc, char **argv) ...@@ -130,7 +132,8 @@ main (int argc, char **argv)
130 char *name = getenv ("MTA_DIAG"); 132 char *name = getenv ("MTA_DIAG");
131 if (name) 133 if (name)
132 { 134 {
133 diag = fopen (name, "w"); 135 char *mode = getenv ("MTA_APPEND") ? "a" : "w";
136 diag = fopen (name, mode);
134 if (!diag) 137 if (!diag)
135 { 138 {
136 mu_error ("%s: can't open diagnostic output: %s", 139 mu_error ("%s: can't open diagnostic output: %s",
......