W B Hacker wrote:
> Wakko Warner wrote:
> > Please keep me CCd.
> > exim v4.64
> >
> > I have the following router on one of my mail servers:
> > auto_whitelist:
> > driver = redirect
> > domains = !+local_domains
> > sender_domains = +local_domains
> > condition = no${lookup mysql{SELECT 'no' \
> > FROM lists.auto_whitelist \
> > WHERE sender='$sender_address_local_part' AND \
> > recipient='${quote_mysql:$local_part}@$domain' \
> > LIMIT 1 \
> > } \
> > {} \
> > {${lookup mysql{REPLACE INTO lists.auto_whitelist \
> > (sender, recipient) \
> > VALUES ('$sender_address_local_part', \
> > '${quote_mysql:$local_part}@$domain') \
> > } \
> > {} \
> > {} \
> > } \
> > } \
> > }
>
> First, put one blank line in right here, then test again.
Same thing. I should mention (again) that changing the blackhole to defer
worked (the router declines, where as with blackhole, it accepts and does
not honour unseen)
> > data = :blackhole:
> > unseen
> > no_verify
> > no_expn
> > no_address_test
> >
>
> Second, I *think* you will need to split that into two separate SQL
> calls. ELSE simplify. See below.
That was 2 seperate SQL statements.
I did remove the outer ${lookup, which works.
It's looking more like a bug. Why did it work with defer, but not
blackhole?
Why does it work now when there's only 1 ${lookup?
> > The only reason for this is to add data to a database at routing time.
> > condition is always "no" so it should never work, unfortunately, it runs only
> > if the SELECT statement returns any data.
>
> See above.
>
> > What's even worse is that unseen
> > is not honoured.
> >
>
> My (many!) all are - but there was a need for that blank line.
As stated, blank line did nothing, same thing.
> > The entire ${lookup is not supposed to return anything.
> >
> > If I comment out the lookup part, it works as expected.
>
> So .. can you just leave it out permanently?
>
> ;-)
No. I *never* want this router handle a recipient. It was only there to
add data into the table.
> > If I comment out the inner ${lookup (the one that does the REPLACE INTO), it
> > also works as expected.
> >
>
> Ditto...
>
> > If I change :blackhole: to :defer:, it works as expected.
> >
>
> That gets the same job done also, at least if done during smtp-time
> rather than in a router...
Not all mail is over smtp and I still want those recipients whitelisted.
> > Any one have any ideas on this?
> >
>
> KISS:
>
> A) If all you want to do is to add the data, see if you can cut it down
> to less SQL code, then run any needed cleanup of 'aged' entries
> separately (and not necessarily even from within Exim, but rather with a
> trigger in the DB).
At the moment, there are no "aged" entries, the data stays indefinately.
I'm not sure why I had the select statement in there before. I think it was
because I used insert instead of replace.
> B) It is less likely to create a 'leaky' router, trash on the queue, or
> need for a bounce if you can do it in an smtp-time acl instead.
> EX: (not line-wrapped the same in the configure file as it is here by my
> MUA):
>
> set acl_c19 = ${lookup pgsql{INSERT into brownlist \
> (pg_when, pg_ip, pg_host) \
> VALUES \
> ('$tod_log','${quote_pgsql:$sender_host_address}','$sender_host_name')}}
I do things similar already in other places.
Would be nice if there was a "null" router available. I plan on adding
another "null" router to gather data for several others (and yes, I know
that exim caches queries)
--
Lab tests show that use of micro$oft causes cancer in lab animals
Got Gas???