diff options
-rw-r--r-- | examples/mta.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/mta.c b/examples/mta.c index f80b7c439..bc88ac6fc 100644 --- a/examples/mta.c +++ b/examples/mta.c @@ -40,6 +40,8 @@ is "localhost". MTA_DIAG Sets the name of the output diagnostic file. By default, the diagnostics goes to stderr. + MTA_APPEND When set to any non-empty value, directs mta to append + to the diagnostics file, not to overwrite it. */ @@ -130,7 +132,8 @@ main (int argc, char **argv) char *name = getenv ("MTA_DIAG"); if (name) { - diag = fopen (name, "w"); + char *mode = getenv ("MTA_APPEND") ? "a" : "w"; + diag = fopen (name, mode); if (!diag) { mu_error ("%s: can't open diagnostic output: %s", |