Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#817244: exim4-base: cron noise re environment

3,659 views
Skip to first unread message

Matthew Vernon

unread,
Mar 9, 2016, 5:50:03 AM3/9/16
to
Package: exim4-base
Version: 4.86.2-2
Severity: normal

Hi,

I now (last few days) get an irritating email every day from anacron,
thus:

/etc/cron.daily/exim4-base:
LOG: MAIN
WARNING: purging the environment.
Suggested action: use keep_environment and add_environment.

This is pretty tiresome!

Thanks,

Matthew

-- Package-specific info:
Exim version 4.86_2 #2 built 05-Mar-2016 12:07:31
Copyright (c) University of Cambridge, 1995 - 2015
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2015
Berkeley DB: Berkeley DB 5.3.28: (September 9, 2013)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM DNSSEC PRDR OCSP
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
Configuration file is /etc/exim4/exim4.conf
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file

dc_eximconfig_configtype='local'
dc_other_hostnames='pick.csi.cam.ac.uk'
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
mailname:pick.csi.cam.ac.uk

-- System Information:
Debian Release: stretch/sid
APT prefers stable
APT policy: (990, 'stable'), (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages exim4-base depends on:
ii adduser 3.113+nmu3
ii anacron 2.3-23
ii cron [cron-daemon] 3.0pl1-128
ii debconf [debconf-2.0] 1.5.58
ii exim4-config [exim4-config-2] 4.86.2-2
ii libc6 2.21-9
ii libdb5.3 5.3.28-11
ii lsb-base 9.20160110
ii netbase 5.3

Versions of packages exim4-base recommends:
ii bsd-mailx [mailx] 8.1.2-0.20160123cvs-2
ii perl-modules-5.22 [perl-modules] 5.22.1-8
ii psmisc 22.21-2.1+b1

Versions of packages exim4-base suggests:
ii bsd-mailx [mail-reader] 8.1.2-0.20160123cvs-2
ii emacs23-lucid [mail-reader] 23.4+1-4
ii emacs24-lucid [mail-reader] 24.5+1-6+b1
pn exim4-doc-html | exim4-doc-info <none>
pn eximon4 <none>
ii file 1:5.25-2
ii icedove [mail-reader] 38.6.0-1
ii mutt [mail-reader] 1.5.24-1+b1
ii openssl 1.0.2g-1
pn spf-tools-perl <none>
pn swaks <none>

-- debconf information:
exim4/purge_spool: false
exim4-base/drec:

Andreas Metzler

unread,
Mar 9, 2016, 12:10:03 PM3/9/16
to
On 2016-03-09 Matthew Vernon <mc...@cam.ac.uk> wrote:
> Package: exim4-base
> Version: 4.86.2-2
> Severity: normal

> Hi,

> I now (last few days) get an irritating email every day from anacron,
> thus:

> /etc/cron.daily/exim4-base:
> LOG: MAIN
> WARNING: purging the environment.
> Suggested action: use keep_environment and add_environment.
[...]

The Debian configuration sets add_environment:

ametzler@argenau:~$ /usr/sbin/exim4 -bP | grep environment
add_environment = <; PATH=/bin:/usr/bin
keep_environment =

Are you using Debian's configuration scheme?

ametzler@argenau:~$ /usr/sbin/exim4 -bV | tail -n1
grep -rl _environment /etc/exim4/

cu Andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

The Wanderer

unread,
Mar 10, 2016, 9:40:04 AM3/10/16
to
I get this same behavior.

> The Debian configuration sets add_environment:
>
> ametzler@argenau:~$ /usr/sbin/exim4 -bP | grep environment
> add_environment = <; PATH=/bin:/usr/bin
> keep_environment =

$ /usr/sbin/exim4 -bP | grep environment
LOG: MAIN
WARNING: purging the environment.
Suggested action: use keep_environment and add_environment.

add_environment =
keep_environment =

> Are you using Debian's configuration scheme?

As far as I know, yes; I certainly don't remember making any changes to
it. If my current exim4 configuration is not the Debian default, I'm
reasonably sure that's news to me.

> ametzler@argenau:~$ /usr/sbin/exim4 -bV | tail -n1

$ /usr/sbin/exim4 -bV | tail -n1
Configuration file is /var/lib/exim4/config.autogenerated

> grep -rl _environment /etc/exim4/

$ grep -rl _environment /etc/exim4/
grep: /etc/exim4/passwd.client: Permission denied

--
The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw

signature.asc

Andreas Metzler

unread,
Mar 10, 2016, 11:10:03 AM3/10/16
to
On 2016-03-10 The Wanderer <wand...@fastmail.fm> wrote:
> Andreas Metzler <amet...@bebt.de> on Wed, 9 Mar 2016 18:07:30 +0100
> I get this same behavior.

>> The Debian configuration sets add_environment:
[...]
> $ /usr/sbin/exim4 -bP | grep environment
> LOG: MAIN
> WARNING: purging the environment.
> Suggested action: use keep_environment and add_environment.

> add_environment =
> keep_environment =

[...]
> $ /usr/sbin/exim4 -bV | tail -n1
> Configuration file is /var/lib/exim4/config.autogenerated

>> grep -rl _environment /etc/exim4/

> $ grep -rl _environment /etc/exim4/
> grep: /etc/exim4/passwd.client: Permission denied

Hello,

Does not look like you are using unmodified up-to-date exim4-config:
ametzler@argenau:/tmp/EXIM4$ dpkg -x /var/cache/apt/archives/exim4-config_4.86.2-2_all.deb exim4-config_4.86.2-2
ametzler@argenau:/tmp/EXIM4$ grep -rl _environment exim4-config_4.86.2-2
exim4-config_4.86.2-2/etc/exim4/exim4.conf.template
exim4-config_4.86.2-2/etc/exim4/conf.d/main/02_exim4-config_options

The Wanderer

unread,
Mar 10, 2016, 12:10:04 PM3/10/16
to
On 2016-03-10 at 11:05, Andreas Metzler wrote:

> On 2016-03-10 The Wanderer <wand...@fastmail.fm> wrote:
>
>> Andreas Metzler <amet...@bebt.de> on Wed, 9 Mar 2016 18:07:30 +0100
>> I get this same behavior.
>
>>> The Debian configuration sets add_environment:
>
>> $ /usr/sbin/exim4 -bP | grep environment
>> LOG: MAIN
>> WARNING: purging the environment.
>> Suggested action: use keep_environment and add_environment.
>>
>> add_environment =
>> keep_environment =
>
>
>> $ /usr/sbin/exim4 -bV | tail -n1
>> Configuration file is /var/lib/exim4/config.autogenerated
>>
>>> grep -rl _environment /etc/exim4/
>>
>> $ grep -rl _environment /etc/exim4/
>> grep: /etc/exim4/passwd.client: Permission denied
>
> Hello,
>
> Does not look like you are using unmodified up-to-date exim4-config:

I didn't see how that could have happened, but you appear to be quite
right, though there's something odd going on.

Yesterday, I did an 'apt-get update'/'apt-get dist-upgrade',
specifically in order to check whether the updated exim4 in testing
fixed this problem. In the morning, when I saw that the cron mail had
still showed up with the same contents, I went looking and found this
bug report.

After receiving your mail, I ran 'apt-get dist-upgrade' again, without
running 'apt-get update' first - and it listed exim4-config as being
available to upgrade. (It appears to have previously been at version
4.86-7.)

I don't know how this can have happened, since as far as I'm aware I had
no pins or holds on exim4-related packages. With exim4-config updated to
version 4.86.2-2, however, I now get the environment results you indicated.

I expect this to have fixed the problem. If I do get the notification
again tomorrow, I will report back.
signature.asc

Matthew Vernon

unread,
Mar 10, 2016, 2:00:04 PM3/10/16
to
Hi,

> The Debian configuration sets add_environment:
>
> ametzler@argenau:~$ /usr/sbin/exim4 -bP | grep environment
> add_environment = <; PATH=/bin:/usr/bin
> keep_environment =
>
> Are you using Debian's configuration scheme?

No, I have my own small config file. Maybe some documentation of what a
sensible add/keep_environment setting could be provided?

Regards,

Matthew

Matthew Vernon

unread,
Mar 15, 2016, 6:40:03 AM3/15/16
to
Specifically, it seems that

add_environment = <; PATH=/bin:/usr/bin

Is what is needed. Maybe the NEWS or README.Debian entry should mention
this?

Regards,

Matthew

Sven Geggus

unread,
Mar 15, 2016, 6:40:03 AM3/15/16
to
Hello,

as I did not really find the solution for people using their own exim4.conf
I think this should be documented here.

I added the following lines to exim4.conf which

add_environment = <; PATH=/bin:/usr/bin
keep_environment =

I hope this is correct.

Sven

Marc Haber

unread,
Mar 15, 2016, 10:00:03 AM3/15/16
to
On Tue, Mar 15, 2016 at 10:33:40AM +0000, Matthew Vernon wrote:
> Specifically, it seems that
>
> add_environment = <; PATH=/bin:/usr/bin
>
> Is what is needed. Maybe the NEWS or README.Debian entry should mention
> this?

Where is the point where the Debian maintainers can stop thinking
about people not using the recommended configuration schemes?

I really don't know.

That being said, please send a suggestion.

Greetings
Marc

--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421

Matthew Vernon

unread,
Mar 15, 2016, 10:10:03 AM3/15/16
to
On 15/03/16 13:51, Marc Haber wrote:
> On Tue, Mar 15, 2016 at 10:33:40AM +0000, Matthew Vernon wrote:
>> Specifically, it seems that
>>
>> add_environment = <; PATH=/bin:/usr/bin
>>
>> Is what is needed. Maybe the NEWS or README.Debian entry should mention
>> this?
>
> Where is the point where the Debian maintainers can stop thinking
> about people not using the recommended configuration schemes?

It's a fair question; I think if it's not too much effort, it's worth
trying to support what is a not-uncommon pattern.

> I really don't know.
>
> That being said, please send a suggestion.

The current text says:

As part of the fix for CVE-2016-1531 updated Exim versions clean the
complete execution environment by default, affecting Exim and
subprocesses such as transports calling other programs, and thus may
break existing installations. New configuration options
(keep_environment, add_environment) were introduced to adjust this
behavior. The debian configuration adds the macros MAIN_KEEP_ENVIRONMENT
and MAIN_ADD_ENVIRONMENT to easily set these options.

I would suggest adding something like

"Users writing their own configuration rather than Debian's templated
approach will need to configure at least one of keep_environment and
add_environment. A suitable minimal configuration would be:
add_envionment <; PATH=/bin:/usr/bin"

Thanks,

Matthew

Andreas Metzler

unread,
Mar 15, 2016, 2:20:03 PM3/15/16
to
On 2016-03-15 Matthew Vernon <mc...@cam.ac.uk> wrote:
[...]
> Specifically, it seems that

> add_environment = <; PATH=/bin:/usr/bin

> Is what is needed. Maybe the NEWS or README.Debian entry should mention
> this?

Hello,

What specific breakage were you experiencing without PATH? FWIW I am
running successfully without. (Nothing fancy, just MX for my domain with
spamassassin.)

I had some discussion about this with upstream (on exim-dev list) and it
boils down to: Often, an empty environment works fine, everything else
depends on the specific local installation. "We can't provide a sensible
default, as it depends on the users need and system environment." Afaict
the setting we have chose for Debian (empty environment) is the correct
one for the Debian config. (If not, please yell.) Documentation for
custom, special circumstances wis imho not placed best in a Debian
specifc documentation but should be integrated upstream.

Sven Geggus

unread,
Mar 15, 2016, 2:30:03 PM3/15/16
to
Andreas Metzler schrieb am Dienstag, den 15. März um 19:09 Uhr:

> What specific breakage were you experiencing without PATH? FWIW I am
> running successfully without. (Nothing fancy, just MX for my domain with
> spamassassin.)

Exim seem to work, but the cronjob breaks without "keep_environment ="

~/ # /etc/cron.daily/exim4-base
LOG: MAIN
Warning: purging the environment.
Suggested action: use keep_environment.

Looks like the "add_environment" option is not needed

Regards

Sven

--
"Arguing that you don't care about the right to privacy because you have
nothing to hide is no different than saying you don't care about free
speech because you have nothing to say." (Edward Snowden)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web

shi...@teksavvy.com

unread,
Mar 17, 2016, 4:00:04 PM3/17/16
to
Package: exim4-base
Version: 4.84.2-1
Followup-For: Bug #817244

Dear Maintainer,

Some supplemental information would be appreciated.

I've edited update-exim4.conf.conf
and added
add_environment='<; PATH=/bin:/usr/bin'
keep_environment=''
one by one then both

I've also edited exim4.conf.template
and added

.ifdef MAIN_KEEP_ENVIRONMENT
keep_environment = MAIN_KEEP_ENVIRONMENT
.else
# set option to empty value to avoid warning.
keep_environment =
.endif
.ifdef MAIN_ADD_ENVIRONMENT
add_environment = MAIN_ADD_ENVIRONMENT
.endif

then replaced with
#.ifdef MAIN_KEEP_ENVIRONMENT
#keep_environment = MAIN_KEEP_ENVIRONMENT
#.else
## set option to empty value to avoid warning.
keep_environment =
#.endif
#.ifdef MAIN_ADD_ENVIRONMENT
#add_environment = MAIN_ADD_ENVIRONMENT
#.endif

Between each edits, I've ran as root
update-exim4.conf
and service exim4 reload

Nothing helped, the exim mainlog is still reporting

2016-03-17 15:30:03 Warning: purging the environment.
Suggested action: use keep_environment.
2016-03-17 15:30:21 Warning: purging the environment.
Suggested action: use keep_environment.
2016-03-17 15:35:02 Warning: purging the environment.
Suggested action: use keep_environment.

every 5 minutes.

Thanks.

-- Package-specific info:
Exim version 4.84_2 #1 built 13-Mar-2016 17:47:17
Copyright (c) University of Cambridge, 1995 - 2014
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2014
Berkeley DB: Berkeley DB 5.3.28: (September 9, 2013)
Support for: crypteq iconv() IPv6 PAM Perl Expand_dlfunc GnuTLS move_frozen_messages Content_Scanning DKIM Old_Demime PRDR OCSP
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch ldap ldapdn ldapm mysql nis nis0 passwd pgsql sqlite
Authenticators: cram_md5 cyrus_sasl dovecot plaintext spa
Routers: accept dnslookup ipliteral iplookup manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore/mbx autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
Configuration file is /etc/exim4/exim4.conf
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file

dc_eximconfig_configtype='smarthost'
dc_other_hostnames='dailyplanet.net'
dc_local_interfaces=''
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.teksavvy.com'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
smtp_receive_timeout='300s'
add_environment='<; PATH=/bin:/usr/bin'
keep_environment=''
mailname:teksavvy.com

-- System Information:
Debian Release: 8.3
APT prefers stable-updates
APT policy: (990, 'stable-updates'), (990, 'stable'), (500, 'oldstable-updates'), (100, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/6 CPU cores)
Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages exim4-base depends on:
ii adduser 3.113+nmu3
ii cron [cron-daemon] 3.0pl1-127+deb8u1
ii debconf [debconf-2.0] 1.5.56
ii exim4-config [exim4-config-2] 4.84.2-1
ii libc6 2.19-18+deb8u3
ii libdb5.3 5.3.28-9
ii lsb-base 4.1+Debian13+nmu1
ii netbase 5.3

Versions of packages exim4-base recommends:
ii bsd-mailx [mailx] 8.1.2-0.20141216cvs-2
ii perl-modules 5.20.2-3+deb8u4
ii psmisc 22.21-2

Versions of packages exim4-base suggests:
ii bsd-mailx [mail-reader] 8.1.2-0.20141216cvs-2
ii emacs24 [mail-reader] 24.4+1-5
pn exim4-doc-html | exim4-doc-info <none>
pn eximon4 <none>
ii file 1:5.22+15-2+deb8u1
ii mutt [mail-reader] 1.5.23-3
ii openssl 1.0.1k-3+deb8u4
pn spf-tools-perl <none>
ii swaks 20130209.0-3
ii xemacs21-mule [mail-reader] 21.4.22-14~deb8u1

-- debconf information:
exim4-base/drec:
exim4/purge_spool: false

Adam D. Barratt

unread,
Mar 17, 2016, 5:10:04 PM3/17/16
to
On Thu, 2016-03-17 at 15:38 -0400, shi...@teksavvy.com wrote:
> Package: exim4-base
> Version: 4.84.2-1
> Followup-For: Bug #817244
>
> Dear Maintainer,
>
> Some supplemental information would be appreciated.
>
> I've edited update-exim4.conf.conf
> and added
> add_environment='<; PATH=/bin:/usr/bin'
> keep_environment=''
> one by one then both

You can't just add random lines to update-exim4.conf.conf and expect
them to end up in your exim configuration.

> I've also edited exim4.conf.template
> and added

The information automatically added to your bug report says:

Configuration file is /etc/exim4/exim4.conf

so that's the file you need to be editing.

Regards,

Adam

Marcel

unread,
Mar 17, 2016, 5:50:03 PM3/17/16
to
Interesting. Thanks Adam. Fixed the issue.

Sorry for the confusion. Blame it on my bad understanding on how
update-exim.conf works. I just read the folowing:

"update-exim4.conf exits silently and does nothing if /etc/exim4/exim4.conf
exists and -o was not used to direct the output to a different
file than /var/lib/exim4/config.autogenerated."

Was having problems with the configuration since migration from exim3. I'll try
to standardize my configuration otherwise issues like that are expected with each
exim update.

No problems with installations on other machines using debconf though.

Best regards!

Matthew Vernon

unread,
Mar 21, 2016, 10:40:03 AM3/21/16
to
On 15/03/16 18:09, Andreas Metzler wrote:
> On 2016-03-15 Matthew Vernon <mc...@cam.ac.uk> wrote:
> [...]
>> Specifically, it seems that
>
>> add_environment = <; PATH=/bin:/usr/bin
>
>> Is what is needed. Maybe the NEWS or README.Debian entry should mention
>> this?
>
> Hello,
>
> What specific breakage were you experiencing without PATH? FWIW I am
> running successfully without. (Nothing fancy, just MX for my domain with
> spamassassin.)

Other than the annoying cron mails, nothing. I picked that value from
the Debian macro that applies it if you're using Debian's config system.
Seemed like the least-surprising value.

Regards,

Matthew
0 new messages