Bug#600007: environment option can not set USER for pipe transport

Andreas Metzler ametzler at downhill.at.eu.org
Wed Oct 13 17:10:29 UTC 2010

On 2010-10-12 Joachim Breitner <nomeata at debian.org> wrote:
> Setting HOME works fine using home_directory. But it seems that I cannot
> set USER via the environment option, as in

> vuser_sieve:
>   driver = pipe
>   command = /usr/lib/dovecot/deliver -f $sender_address
>   home_directory = /var/vhosts/$domain/$local_part
>   environment = USER="$local_part@$domain"

> (with or without the quotes, does not matter)

> Reading the code (./src/transports/pipe.c, function
> pipe_transport_entry), I see that the entries from the environment
> option are just appended to the list of environment variables, so I
> assume that both values for USER – exim’s default and the one I set –
> are passed in the environment, leading to undefined behaviour.

This is also documented. (spec.txt 29.4 Environment variables: "The
environment variables listed below are set up when the command is
invoked. [...] Note that the environment option can be used to add
additional variables [...]")

> I think it would be better if entries in environment really override the
> defaults from exim.

> For me, this is not critical, as it only affects the logging output. But
> it certainly is unexpected behaviour. Such a setup is also recommended
> by dovceot, see the example on http://wiki.dovecot.org/LDA/Exim at the
> very bottom.

I will forward this upstream. Shouldn't this do as a workaround for
the time being?

command = /usr/bin/env USER="$local_part@$domain" /usr/lib/dovecot/deliver -f $sender_address

cu andreas

More information about the Pkg-exim4-maintainers mailing list