Don't issue env warning if env is empty
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Fri, 11 Mar 2016 22:44:53 +0000 (23:44 +0100)
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Fri, 11 Mar 2016 23:10:01 +0000 (00:10 +0100)
keep_environment needs to be mentioned in the runtime config.
Setting add_environment isn't enough to suppress the warning.

doc/doc-docbook/spec.xfpt
src/src/readconf.c
test/confs/0615
test/stderr/0615

index 33d9c34cb9bda5b1a3815c0f84ea7fa1d95755e5..1239b16909600c217c980ec7425ffdc021fdc25f 100644 (file)
@@ -15115,9 +15115,10 @@ FOO and having FOO_HOME in your &%keep_environment%& option may have
 unexpected results. You may work around this using a regular expression
 that does not match the macro name: ^[F]OO_HOME$.
 
-Current versions of Exim issue a warning during startupif you do not mention
-&%keep_environment%& or &%add_environment%& in your runtime configuration
-file.
+Current versions of Exim issue a warning during startup if you do not mention
+&%keep_environment%& in your runtime configuration file and if there is
+anything in your environment. Future versions may not issue that warning
+anymore.
 .wen
 
 
index 328d4955841d6515919a332d7987b0c5725f604b..0f696cbf5e79d0b1ca37394d2b1298e053ea0739 100644 (file)
@@ -3503,10 +3503,10 @@ if (gnutls_require_kx || gnutls_require_mac || gnutls_require_proto)
       " are obsolete\n");
 #endif /*SUPPORT_TLS*/
 
-if ((!add_environment || *add_environment == '\0') && !keep_environment)
+if (!keep_environment && environ && *environ)
   log_write(0, LOG_MAIN,
-      "WARNING: purging the environment.\n"
-      " Suggested action: use keep_environment and add_environment.");
+      "Warning: purging the environment.\n"
+      " Suggested action: use keep_environment.");
 }
 
 
index bbfc4978aa750917cb6c3caa19c7988a787a0081..86ecee108b9eefca52a9a66d6bb93b7bf423dc15 100644 (file)
@@ -1,6 +1,7 @@
 # exim test configuration 0615
 exim_path = EXIM_PATH
 tls_advertise_hosts =
+spool_directory = DIR/spool
 perl_startup = $| = 1; \
        print "Environment visible in Perl:\n"; \
        print map { "$_=$ENV{$_}\n" } sort keys %ENV;
index 85ee6f7600b6763d04607c3bb06f94b63a9b3ccb..d8d0f8547dfd7533118ad13424ea4765a2585b5f 100644 (file)
@@ -1,15 +1,11 @@
 LOG: MAIN
-  WARNING: purging the environment.
- Suggested action: use keep_environment and add_environment.
-
+  Warning: purging the environment.
+ Suggested action: use keep_environment.
 LOG: MAIN
-  WARNING: purging the environment.
- Suggested action: use keep_environment and add_environment.
-
+  Warning: purging the environment.
+ Suggested action: use keep_environment.
 LOG: MAIN
-  WARNING: purging the environment.
- Suggested action: use keep_environment and add_environment.
-
-1999-03-02 09:44:33 WARNING: purging the environment.
- Suggested action: use keep_environment and add_environment.
-
+  Warning: purging the environment.
+ Suggested action: use keep_environment.
+1999-03-02 09:44:33 Warning: purging the environment.
+ Suggested action: use keep_environment.