Re: [Exim] Question about 'condition' parameter

Pàgina inicial
Delete this message
Reply to this message
Autor: Axel Hollanda
Data:  
A: exim-users
Assumpte: Re: [Exim] Question about 'condition' parameter
For those who, just like me until few hours ago, want to know how to do
mysql queries within if statements here it is:

Axel Hollanda wrote:

The algorithm:

> if $sender_adress matches content @ mysql_black_list_table
>     block mail
>  or


here I changed to AND

>
>  if $header_subject matches content @ mysql_black_list_table
>     block mail

>

The syntax:

        condition =     ${if and { \


{!match{$sender_address}{${lookup mysql{select content from user_hbl \
                                                where
username='${quote_mysql:$local_part}' and \


content='$sender_address'} {$value} {fail} }}} \
                                        {!match{$h_subject:}{${lookup
mysql{select content from user_hbl \
                                                where
username='${quote_mysql:$local_part}' and \
                                                content='$h_subject:'}
{$value} {fail} }}} \
                                } \
                          {yes}{no} \
                          }


    If you don't use the default ${value} set, it won't work as far as I
see.


Cheers.

PS: it didn't hurt to send an reply for a simple question like that.

>   The header_subject part isn't implemented yet.
> --
> ###################################################-------...
> # Axel Hollanda                                             `
> # ahollanda@???                                     ;
> #############################################################


--
###################################################-------...
# Axel Hollanda                                             `
# ahollanda@???                                     ;
#############################################################