Re: [Exim] Blocking based on the subject (Possible bug in ex…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Darren Casey
Ημερομηνία:  
Προς: Rick Cooper, Exim Users
Υ/ο: ph10
Αντικείμενο: Re: [Exim] Blocking based on the subject (Possible bug in exim 4.22?)
> > > 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


I tried your following example work for word and it fails in exim 4.22

>
> 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:}}'


OK with this in it blocks the e-mail but does NOT quote the $rh_Subject in
the error message its just blank

The debug reports :-
Exim version 4.22 uid=0 gid=0 pid=1417 D=8
Berkeley DB: Sleepycat Software: Berkeley DB 3.1.17: (July 31, 2000)
Support for: iconv()
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile autoreply pipe smtp
configuration file is /usr/exim/configure
log selector = 060d99d8
trusted user
admin user
1417 listening on all interfaces (IPv4) port 25
1417 pid written to /var/run/exim.pid
1417 LOG: MAIN
1417 exim 4.22 daemon started: pid=1417, no queue runs, listening for
SMTP on port 25 (IPv4)
1417 daemon running with uid=8 gid=100 euid=8 egid=100
1417 Listening...
1417 Connection request from 192.168.0.125 port 1665
1417 1 SMTP accept process running
1417 Listening...
1443 Process 1443 is handling incoming connection from [192.168.0.125]
1443 LOG: host_lookup_failed MAIN
1443 no host name found for IP address 192.168.0.125
1443 Process 1443 is ready for new message
1443 LOG: MAIN REJECT
1443 H=(LAPTOP) [192.168.0.125] F=<darren@???> rejected
RCPT <reply@???>: Bad Mojo For You With the Subject Of
1443 LOG: smtp_connection MAIN
1443 SMTP connection from (LAPTOP) [192.168.0.125] closed by QUIT
1417 child 1443 ended: status=0x0
1417 0 SMTP accept processes now running
1417 Listening...

The subject DID NOT match the condition, somewhere the subject variable is
being missed

I am filtering based on everything else I needed just not the subject it
just seems to be blank...

>
> 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)


Thanks

Darren