Re: Blocklist with multiple SELECT-fields
- Jørn Skjerven a écrit :
> Hi everybody!you're trying to return two columns when postfix lookups want one.
> I'm trying to implement a blocklist based on a MySQL lookuptable. It
> works for returning single values like REJECT or OK, but I want it to
> return 4XX "some text" the same way as can be done using a standard
> accessmap. The problem is to return the TEXT.
> I have tried the following query:
> query = SELECT action,text FROM blocked_accounts WHERE address = '%s'
either rebuild your tables to mix the action and text (in your example,
I don't see why you would have two fields...) or compose the fields into
a single one. whatever you chose, a VIEW is probably a good idea.
>no, that's not what "it returns". that's what your shell mysql command
> which returns:
> postmap -q "account"
> 452,The account is over quota, please try to resend the email later
prints on your terminal. but your mysql query returns two columns.
postfix maps want a single result. a trivial fix would be to use CONCAT().
> This is set up in smtpd_recipient_restrictions as
> This does not work and logs the following:
> Feb 24 09:11:29 mx2 postfix/smtpd: NOQUEUE: reject: RCPT from
> srv106.webdeal.no <http://srv106.webdeal.no>[18.104.22.168]: 451 4.3.5
> Server configuration error; from=<sender> to=<account> proto=SMTP
> helo=<srv106.webdeal.no <http://srv106.webdeal.no>>
> Is there any way to make this work, woraround or alterative setup that
> can be used ?
> Jørn Skjerven
> WebDeal AS