RE: [Exim] Blocking based on the subject

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Rick Cooper
Date:  
À: Exim Users
Sujet: RE: [Exim] Blocking based on the subject
> -----Original Message-----
> > i *think* you can access it like $h__subject or $h_subject
> >
> > don't remember how exim does it -- but there's some prefix like $h_
> > that lets you plug in header fields with. its somewhere in the docs.
> >
>
> Thanks but I get
> 9355 H=(LAPTOP) [192.168.0.125] F=<test@???>
> temporarily rejected
> RCPT <carpe@???>: failed to expand ACL string
> "${lookup mysql
> {SELECT true FROM block WHERE condition =
> '${quote_mysql:${h_subject}}' and
> type='subject' AND user = '${quote_mysql:$local_part}' limit
> 1}{$value}}":
> unknown variable in "${h_subject}"
>
> I suspect its something to do with :-
>

<snip>

I tried the following test which works just as it should with a subject of:
    this subject has ONE in the middle


deny message = Bad Mojo For You With the Subject Of $rh_Subject
set acl_c9 = ONE
    condition = ${if or {\
                    {!eq{$rh_Subject:}{}}\
                    {match{${lc:$acl_c9}}{${lc:$rh_Subject:}}}\
                    }\
                    {yes}{no}}


I think the problem may be the fact you are not adding the : in $rh_Subject:
so I think it would be '${quote_mysql:${h_subject:}}'

You might try '%${quote_mysql:${h_subject:}}%' (which is why I trapped the
blank subject)
to match if the subject CONTAINS the user's target string ... I would think
you would also want to normalize the case in the table and the subject
string for better matching (both lc or uc)