RE: [exim] FW: dnslists : Mysql Lookup

Pàgina inicial
Delete this message
Reply to this message
Autor: Eli
Data:  
A: 'Bill Hacker', 'Michael', 'exim'
CC: 
Assumpte: RE: [exim] FW: dnslists : Mysql Lookup
Michael wrote:
> Thanks,
>
> I've just dumped it to a file and it reads two results
>
> One after another without a space in a text file which would explain
> something but doesn't really match up with my error from the Exim log.
>
> You mentioned concatenating the result but will this work with
> multiple rows as they are just not fields from within the same result
> set


The correct answer to your question is already documented in Exim with
regards to SQL queries. It mentions that you get newlines and such at each
row of a query, so if you're getting multiple rows, you're getting
<word1>\n<word2> (maybe another \n at the end but that's not your problem).
Exim sees the \n in between and barfs - it's not built to understand what
you want with the \n character.

To fix this, wrap your query reply (final field in your lookup statement,
normally either blank, or {$value}) like this:

    ${sg{$value}{\\n}{, }}


This translates all \n's to a comma and space, or in your case you'll want a
colon and a space because this is what 2 blacklists look like:

    dnslists = sbl-xbl.spamhaus.org : bl.spamcop.net





Bill Hacker wrote:
>.... and no need for the above monkey-motion at all.


Talk about monkey-motion! For such a relatively simple answer, you had the
man running around town with his pants down ;P


Eli.