Re: [Exim] environment vars & extension addresses

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Jason R. Mastaler
CC: exim-users
Assumpte: Re: [Exim] environment vars & extension addresses
On Tue, 30 Oct 2001, Jason R. Mastaler wrote:

> I'm running a script that is invoked from the user's .forward and
> which needs the following information to do its processing:
>
> - the full envelope sender address
>
> - the full envelope recipient address
>
> - the address extension (e.g, with mail sent to johndoe+foo, the
> address extension is foo)
>
> With qmail and Postfix this is very easy as all three are provided as
> environment variables (SENDER, RECIPIENT, and EXTENSION).


Exim doesn't put all of this information in the environment, but the
information is available in Exim variables which you can pass over to
your script as arguments. For example, in the .forward file you could
have

|/name/of/script $sender_address $local_part $local_part_suffix

and the information you require will be put in the first three arguments
that are passed to the script.

> There is no RECIPIENT variable, so is there a reliable way to discern
> this info from the other variables? Perhaps LOCAL_PART + DOMAIN?


Indeed.

> What happened to the `+foo'? There is no mention of it in the
> environment. Is there a way to fix this?


The set of environment variables has never been changed since the very
early releases of Exim. When I implemented it, I copied Smail and
created a minimal list. (Address extensions didn't exist in those days.)
Why has the environment not been changed? Answer: because nobody has
ever raised the issue before! Consequently, I haven't ever revisited it.

I think I'd like to keep the environment small, because otherwise the
requirement to put more and more information in it is very open-ended.
However, I can see a case for LOCAL_PART_PREFIX and LOCAL_PART_SUFFIX so
that the entire recipient address is available by that means.


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.