Re: [Exim] using dbdns lookup

Etusivu
Poista viesti
Vastaa
Lähettäjä: Philip Hazel
Päiväys:  
Vastaanottaja: emf
Kopio: exim-users
Aihe: Re: [Exim] using dbdns lookup
On Tue, 17 Apr 2001, emf wrote:

> Yes, it did seem a bit odd- I suspected that something like that was the
> case, yet I never would have guessed that I needed to escape it as you
> suggested.


From the manual, chapter 18 (The Pipe Transport):

18.2 How the command is run

The command line is (by default) broken down into a command name and arguments
by the "pipe" transport. The "allow_commands" and "restrict_to_path" options
can be used to restrict the commands that may be run. Unquoted arguments are
delimited by white space; in double-quoted arguments, backslash is interpreted
as an escape character in the usual way. This does not happen for single-
quoted arguments.

String expansion is applied to the command line except when it comes from a
traditional .forward file (commands from a filter file are expanded). The
expansion is applied to each argument in turn rather than to the whole line.
For this reason, any string expansion item that contains white space must be
quoted so as to be contained within a single argument. A setting such as

    command = /some/path ${if eq{$local_part}{postmaster}{xxx}{yyy}}


will not work, because the expansion item gets split between several argu-
ments. You have to write

    command = /some/path "${if eq{$local_part}{postmaster}{xxx}{yyy}}"


to ensure that it is all in one argument. If the whole command line is quoted,
then the internal quotes have to be escaped with backslashes (or single quotes
can be used). The expansion is done in this way, argument by argument, so that
the number of arguments cannot be changed as a result, and quotes or
backslashes in inserted variables do not interact with external quoting.

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