Re: [Exim] List-separator of null character?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Phil Pennock
CC: Exim Users
Subject: Re: [Exim] List-separator of null character?
On Tue, 5 Aug 2003, Phil Pennock wrote:

> We put lots of data into CDB files. We do extractions, no problem. But
> the list separator remains a colon, or can be set to any other
> character;


I don't understand what you are saying here. There is no "list
separator" in a CDB file. Or are you asking "how do I make keys in a CDB
file that contain colons?" The answer to that is to look at the scripts
or whatever you are using to build the CDB files. IIRC, the basic format
uses counts, but there is a script that converts to this from the
conventional "alias file" format with colons terminating the keys.

[Aside: Note that in Exim's lsearch lookups, you can use quotes to get
colons into keys:

"this:key:contains:colons": this is the data

]

> <"foo:bar;wibble!#$baz"@???>
>
> is a perfectly valid email address.


True.

> Is there any way to set the list separator to be a null character, '\0'?


I'm still not sure which list separator you are talking about, but the
answer is almost certainly no, because Exim uses C strings. I think if I
were starting again from scratch, I wouldn't have done that, but it too
late now.

> I'd really like to be able to say something like:
>
>    local_parts = <\0 $domain_data


Aha. I see the problem. I'm afraid you can't do that. So you have to
pick *some* separator for the items in your list. If you want to be
clever, you could use some string that is more than one character long,
and hopefully unlikely to occur. As someone suggested, perhaps 8-bit
characters are the answer here. Then use some string expansion trickery
to (a) convert colons in the actual data to double colons and then (b)
convert your magic strings into colons. (Or whatever you want instead of
colons.) However, you can't have binary zeros anywhere, sadly.

An alternative would be make $domain_data expand into another lookup
rather than an actual list.

> (and no, I don't know of any customers _wanting_ a colon in their email
> addresses, but I don't believe in building systems which impose silent
> restrictions)


Agreed.


--
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