Re: [Exim] The absolute ULTIMATE spam tool feature I need

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Marc Perkel
CC: exim-users
Subject: Re: [Exim] The absolute ULTIMATE spam tool feature I need
On Mon, 12 May 2003, Marc Perkel wrote:

> if "$h_received:" matches "${readfile{/etc/exim/blockhosts}{|}}"


Haven't I emailed you before about this? I seem to remember discussing
it with somebody. With some clever use of $sg{ you can get rid of blank
lines and a trailing newline if you want to.

> So - again - what I need is a readfile that is just a little smarter
> that the one we have now. A readfile that ignores blank lines, comment
> lines, and no newline on the last entry. That would do it for me.


There are (as always) several ways you can do this. Apart from using
$sg{ you could always preprocess the file yourself from a text file that
you edit into a one-line file that Exim reads. If you used a script to
update, you can always ensure that you rebuild after editing, rather
like using a cdb file for aliases. That would be much more efficient
than using ${sg.

However, using a huge regular expression like this will never be
particularly efficient. I would definitely advise studying Jeff Friedl's
book so that you write your regexes to be as efficient as possible.

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.