[Exim] Re: Router condition lookup: line-delimited file cont…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Sheldon Hearn
Dátum:  
Címzett: exim-users
Tárgy: [Exim] Re: Router condition lookup: line-delimited file contains
On (2003/11/10 15:20), Sheldon Hearn wrote:

> I'm lost in lookups within router conditions.
>
> Is there some foo I can do in a router condition that resolves to true
> if a line-delimited file contains some string? Something like
>
> condition = ${lookup{${local_part}@${domain}}XXX{/path/to/addrfile}{1}}
>
> where addrfile contains a line-delimited list of email addresses.


FYI, this works, even if it's ugly. Note that comment lines in the
file must not contain email addresses; better pretend comments aren't
supported:

condition = \
  ${if \
    match \
      { ${readfile{/usr/local/etc/exim/spam_tagging_recipients}{ }} } \
      {(^| )${local_part}\\@${domain}( |\$)} \
    {1} \
  }


I can't use local_parts = /usr/local/etc/exim/spam_tagging_recipients
because this is on a dnslookup router. Sadly, there seems to be no
"recipient" option for routers.

There _must_ be a cleaner way, mustn't there?

Ciao,
Sheldon.