exim4 says "Warning: purging the environment" even though add/keep_environment are set

2

Recent versions of exim4 added add_environment and keep_environment to the config. If those are missing, exim4 sends a warning to STDERR.

In my configuration, both of those variables are set to blank:

add_environment =
keep_environment =

This is a valid configuration. It's working on all of my servers, except for one, where it sends out the warning.

Working server:

$ exim4 -bP | grep environment
add_environment =
keep_environment =

Non-working server:

$ exim4 -bP | grep environment
LOG: MAIN
  Warning: purging the environment.
 Suggested action: use keep_environment.
add_environment =
keep_environment =

The configuration is the same on both servers. Both servers are running the latest version of Debian (8.7/jessie) and they're both running the same version of exim: Exim version 4.84_2 #2 built 02-Jan-2017 18:43:31

Ian Ling

Posted 2017-04-24T18:03:31.363

Reputation: 51

Answers

0

That is just an annoying and harmless bug in the latest releases and will be removed sooner or later. Just ignore it.

Kondybas

Posted 2017-04-24T18:03:31.363

Reputation: 499

What a crap, bugs all over. – Mike Mitterer – 2017-08-11T11:48:05.430

0

exim4 -bP will only show you currently used values, including the the ones exim4 itself set up to defaults after outputing the warnings.

You should check with grep -r keep_environment /etc/exim4 to see if it is indeed active in your config file. It should be in /etc/exim4/exim4.conf if you use that. If you have /etc/exim4/exim4.conf but the option is in /etc/exim4/exim4.conf.template, you may need to add it manually or use update-exim4.conf(8).

You can find more info here

Matija Nalis

Posted 2017-04-24T18:03:31.363

Reputation: 2 107

0

You can't tell if an option is not set or has no value from exim -bP output. Since the latter simply iterates all the available options and prints their values.

Most likely one of the servers has keep_environment option in its config. Places to check are /etc/exim4 and /var/lib/exim4/config.autogenerated.

The option was introduced to circumvent a certain security threat. The fix was made in 4.86.2. But also backported to 4.84.2. Both Jessie and Stretch have it. It cleans the environment according to keep_environment, add_environment options. If keep_environment is not set, it logs a warning and suggests to add it. Since exim might be configured in a way that needs to keep some environment variables. Which is not the case on Debian with the default config. So on Debian normally it can be set to empty value.

And at some point the option was added to the config (4.87--RC6-3). But it was in Debian Stretch. That's unlikely to be backpoirted to Jessie, since it is no security issue.

The solution is to add it to /etc/exim4/exim4.conf.localmacros manually:

keep_environment =

Then:

update-exim4.conf
systemctl reload exim4

x-yuri

Posted 2017-04-24T18:03:31.363

Reputation: 225