Re: [exim] New lines in an in-line ACL

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Philip Hazel
Fecha:  
A: Fred Viles
Cc: exim-users
Asunto: Re: [exim] New lines in an in-line ACL
On Thu, 9 Sep 2004, Fred Viles wrote:

> | I thought the double quotes would have allowed me
> | to embed real newline characters. If you'd care
> | to pass along why that doesn't work, I'd love to
> | hear it.
>
> I can't speak to the reasoning behind Philip's design choices, but
> the documentation gives me no reason to expect literal newlines
> within a quoted string to behave as you expected.


Indeed. If you want a newline within a quoted string you must use \n
whether or not the string is actually split over more than one physical
input line. The following should all work:

acp_smtp_rcpt = xxx\nyyy
acl_smtp_rcpt = "xxx\nyyy"
acl_smtp_rcpt = xxx\n\
                yyy
acl_smtp_rcpt = "xxx\n\
                 yyy"


They are processed subtly differently: in the quoted cases, the \n is
interpreted when the configuration file is read in; in the other cases
it is interpreted when the string is expanded. (Not all options are
expanded; for those that are not, you have to use quotes if you want to
include newlines.)

> The config file processing is line oriented, the only documented way
> to have a single statement span multiple physical lines is to use
> explicit line continuation syntax. In which case the trailing
> backslash and all whitespace trailing (on the continued line) and
> leading (on the continuation line) whitespace is ignored, including
> the newline.


Yup.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book