Preserve environment variables for doveadm

Teodor Milkov tm at del.bg
Wed Mar 1 13:43:54 UTC 2017


Hello,

I noticed there are ways to instruct various dovecot processes to 
preserve particular environment variables.

One way is to use import_environment in dovecot.conf and yet another is 
to export DOVECOT_PRESERVE_ENVS variable – both can contain space 
delimited list of variables to preserve.

I found report that this is supposed to work for dsync: 
http://www.dovecot.org/list/dovecot/2012-October/138659.html

Unfortunately I can't it to work for "doveadm quota recalc".

Is it supposed to work or am I doing something wrong?

I did strace on the doveadm process and noticed it does exec() doveconf 
which in turn does exec() doveadm again. If I replace doveconf with a 
shell script which exports my environment variables then they become 
available to doveadm:

# cat /dovecot/bin/doveconf.wrapper

#!/bin/sh
export LD_PRELOAD='dovecot-preload.so'
exec /dovecot/bin/doveconf.orig "$@"



More information about the dovecot mailing list