Re: [exim] Sourcing Exim Filter from MySQL/MariaDB table?

Pàgina inicial
Delete this message
Reply to this message
Autor: Jeremy Harris
Data:  
A: exim-users
Assumpte: Re: [exim] Sourcing Exim Filter from MySQL/MariaDB table?
On 08/05/2019 00:39, Mike Tubby via Exim-users wrote:

> user_filter:
>     driver = forwardfile
>     data = ${lookup mysql{SELECT rule FROM users LEFT JOIN domains \
>         ON domains.id=users.domain_id LEFT JOIN filters \
>         ON users.id=filters.user_id WHERE
> domains.domain='${quote_mysql:$domain}' \
>         AND users.username='${quote_mysql:$local_part}' \
>         AND domains.active=1 \
>         AND users.active=1 \
>         AND filters.active=1}}
>     no_verify
>     no_expn
>     check_ancestor


Where's your rule ordering? And what on earth is "forwardfile" ?

> Am I going to need to arrange for the database result set to start with
> '# Exim Filter' each time or is their a boolean to force this?
>
> If there isn't a boolean to force it, then it would be good to have a
> 'is_filter' boolean ;-)


No, there's not enough call for that; it's your problem :)
It's only a string; just glom it on before the result
of the DB lookup expansion.

> As far as memory utilisation goes, won't Exim discard any memory it
> allocated for the result set at the end of the delivery?


Yes. I wasn't meaning permanent.
--
Cheers,
Jeremy