When I first implemented Exim, it seemed tidy to restrict the special
role of backslash to inside quotes. Since that time:
(a) Rewriting rules have needed to be continued - backslash is used
without quotes.
(b) Macros got invented - they are continued by backslash without quotes.
(c) Regular expressions have been made available inside expanded
strings, which themselves use backslash for escaping.
The last of these leads to messy things like
file = "/var/mail/\
${if match {$local_part}\
{^\\\\d{8}@example\\\\.com\\$}{special/}}\
$local_part"
and writing about this stuff has got me sufficiently bothered to
consider changing it.
Proposal: Change the rules so that backslash at the end of a line
(ignoring trailing white space) is always a continuation, whether or not
it is in quotes, with leading white space on the next line removed. This
is almost upwards-compatible: the only case where it isn't is if an
existing, non-quoted, setting ends in backslash, which doesn't seem very
likely. Such settings, if there are any, would have to be quoted.
This change would allow the above example to be written as
file = /var/mail/\
${if match {$local_part}\
{^\\d{8}@example\\.com\$}{special/}}\
$local_part
and the use of quotes would be necessary only if you wanted to use
backslash for generating special characters like \n.
Opinions?
--
Philip Hazel University of Cambridge Computing Service,
ph10@??? Cambridge, England. Phone: +44 1223 334714.