Re: [exim] Escaping colon in colon-separated lists (environm…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Stephen Gran
Date:  
À: exim-users
Sujet: Re: [exim] Escaping colon in colon-separated lists (environment)
On Fri, Mar 25, 2005 at 08:48:05AM +0100, Bob Johannessen said:
> Consider the following fragment from a pipe transport:
>
> ------------------------------------------------------------------------
>         environment =AUTH=$authenticated_id           \
>                     :SUBJECT=$header_subject:         \
>                     :TO=$header_to:
> ------------------------------------------------------------------------

>
> And the following from the Exim specification:
>
> ------------------------------------------------------------------------
> environment
> Use: pipe
> Type: string, expanded
> Default: unset
>
> This option is used to add additional variables to the environment
> in which the command runs (see section 29.4 for the default list).
> Its value is a string which is expanded, and then interpreted as a
> colon-separated list of environment settings of the form
> ?<name>=<value>?.
> ------------------------------------------------------------------------
>
> Question:
>
> Is it possible to get all the contents of the Subject: header field
> into the SUBJECT environment variable even if it contains a colon?
>
> So far I've tried I have tried:
>
> :"SUBJECT=$header_subject:"
> ":SUBJECT=$header_subject:"
> :SUBJECT=$sg{{$header_subject:}{:}{\\:}}
> :SUBJECT=${quote{$header_subject:}}
>
> and probably a few other things, but with no luck. The only way I've
> found so far to even get anything *past* the first colon into the
> environment variable is something like this
>
> :SUBJECT=${tr{$header_subject:}{:}{_}}
>
> which is far from ideal.
>
> Am I trying to do the impossible here?


Use a different field delimiter in your statement, e.g., < ;

See 6.15 in the spec.
--
--------------------------------------------------------------------------
|  Stephen Gran                  | Sometimes, too long is too long.   --   |
|  steve@???             | Joe Crowe                               |
|  http://www.lobefin.net/~steve |                                         |

--------------------------------------------------------------------------