Re: [exim] Quick how do I do this question

Pàgina inicial
Delete this message
Reply to this message
Autor: Fred Viles
Data:  
A: exim-users
Assumpte: Re: [exim] Quick how do I do this question
On 3 Oct 2005 at 12:16, Marc Perkel wrote about
    "[exim] Quick how do I do this quest":


| Lookups confusr me.


Have you found time to read spec.txt yet? That might help.

| I have a text file where I'm storing from headers that look like this:
|
| Evite <info@???>
| Evan Prodromou <evan@???>
| support@???
| "Neowin.net" <nboard@???>
| laurent <charazac.laurent@???>
|
| In an ACL I want to do a condition to look up the $h_From: to see if it
| matches and lines in this file.


You can use lsearch. The only tricky bit is the spaces. Note this
bit from TFM's description of lsearch in section 9.2:

    In most lsearch files, keys are not required to contain colons or #
    characters, or whitespace. However, if you need this feature, it is
    available. If a key begins with a doublequote character, it is terminated
    only by a matching quote (or end of line), and the normal escaping rules
    apply to its contents (see section 6.12). An optional colon is permitted
    after quoted keys (exactly as for unquoted keys). There is no special
    handling of quotes for the data part of an lsearch line.


So you'll have to quote those lines in your file:

"Evite <info@???>"
"Evan Prodromou <evan@???>"
support@???
"\"Neowin.net\" <nboard@???>"
"laurent <charazac.laurent@???>"

| How do I do that?


    condition - ${lookup {$h_from:} lsearch {/path/to/fromfile} {yes} {no}}


- Fred