Re: [Exim] Passing Environment Variables to a pipe

Top Page
Delete this message
Reply to this message
Author: Kirill Miazine
Date:  
To: exim-users
Subject: Re: [Exim] Passing Environment Variables to a pipe
* Dan Egli [2002-11-30 00:01]:
> Ok. I'm rather lost here. I hope someone can help me out. I'm running
> Exim 4.10, and all seems to be working great except that I'm trying to
> pass environment variables to procmail so that if a certain recipie is
> processed, it has the information it needs in these variables. However,
> nothing I have entered into the exim.conf seems to be making any
> difference. Here's what I'm trying to do:
>
> Three environment variables are created whenever procmail is called:
>
> SENDER: Who is the envelope's mail from: user is ($sender_address)
> EXTENSION: $local_part_suffix
> RECIPIENT: $local_part$local_part_suffix@$domain
>
> However, I wrote a wrapper script when I was having problems. The
> wrapper script dumps the current environment to a file before executing
> the specified commands. Here's my result file: (some lines will probably
> wrap)

...
>
> As you can see, the three variables I mentioned are NOT listed. I don't
> understand why. Here's my Procmail transport:
>
> procmail_transport:
> driver = pipe
> command = "/usr/bin/procmail -p -d ${local_part}"
> delivery_date_add
> envelope_to_add
> no_freeze_exec_fail
> group = mail
> no_log_defer_output
> no_log_fail_output
> no_return_fail_output
> return_path_add
> umask = 0022
> environment = EXTENSION=${substr_1:local_part_suffix}:\

                                      ^ <- this should be doubled

>                 RECIPIENT=$local_part$local_part_suffix@$domain


This is wrong! Better to say (note the ";" used as the list separator):

environment = <; EXTENSION=${substr_1:$local_part_suffix} ; \
                 RECIPIENT=$local_part$local_part_suffix@$domain


You're also missing the "$" in $local_part_suffix

> Funny, I don't see any that match this. Shell for example, is not
> /bin/sh but /bin/bash. I don't see a TZ, USER, MESSAGE_ID, etc...


I don't use procmail, but with maildrop you have to import variables
explicitly.

Besides, your transport was badly configured. environment option expects
a list. All colons should be doubled unless you use something else to
separate list items. See my example above.

--
Kirill Miazine, Stud.Jur.                          mailto:sig@krot.org
Faculty of Law, University of Oslo                 http://km.krot.org/