URL: https://www.opennet.ru/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID1
Нить номер: 92305
[ Назад ]

Исходное сообщение
"Помогите отключить для одного домена greylist(exim)"

Отправлено bobot , 21-Сен-11 18:05 
вот такое я условие ставлю в начале


begin acl
.ifdef GREYLIST_ENABLED
greylist_acl:
deny condition = ${if eq{${lookup mysql{SELECT email FROM whitelist WHERE email = '$domain'}}}{}{yes}{no}} ------- вот я ставлю
  # For regular deliveries, check greylist.

  # check greylist tuple, returning "accepted", "deferred" or "unknown"
  # in acl_m8, and the record id in acl_m9

  warn set acl_m8 = ${lookup mysql{GREYLIST_TEST}{$value}{result=unknown}}
       # here acl_m8 = "result=x id=y"

       set acl_m9 = ${extract{id}{$acl_m8}{$value}{-1}}
       # now acl_m9 contains the record id (or -1)

       set acl_m8 = ${extract{result}{$acl_m8}{$value}{unknown}}
       # now acl_m8 contains unknown/deferred/accepted

  # check if we know a certain triple, add and defer message if not
  accept
       # if above check returned unknown (no record yet)
       condition = ${if eq{$acl_m8}{unknown}{1}}
       # then also add a record
       condition = ${lookup mysql{GREYLIST_ADD}{yes}{no}}

  # now log, no matter what the result was
  # if the triple was unknown, we don't need a log entry
  # (and don't get one) because that is implicit through
  # the creation time above.
  .ifdef GREYLIST_LOG_ENABLED
  warn condition = ${lookup mysql{GREYLIST_LOG}}
  .endif
# check if the triple is still blocked
  accept
       # if above check returned deferred then defer
       condition = ${if eq{$acl_m8}{deferred}{1}}
       # and note it down
       condition = ${lookup mysql{GREYLIST_DEFER_HIT}{yes}{yes}}

  # use a warn verb to count records that were hit
  warn condition = ${lookup mysql{GREYLIST_OK_COUNT}}

  # use a warn verb to set a new expire time on automatic records,
  # but only if the mail was not a bounce, otherwise set to now().
  warn !senders = : postmaster@*
       condition = ${lookup mysql{GREYLIST_OK_NEWTIME}}
  warn senders = : postmaster@*
       condition = ${lookup mysql{GREYLIST_OK_BOUNCE}}

  deny
.endif

если так


deny condition = ${if eq{${lookup mysql{SELECT email FROM whitelist WHERE email = '$domain'}}}{}{yes}{no}}

То все письма проходят вообще без проверки Greylist

если так


deny condition = ${if eq{${lookup mysql{SELECT email FROM whitelist WHERE email = '$domain'}}}{}{no}{yes}}

То тогда все письма проходят проверку Greylist , т.е. реакции на домен
??

Содержание

Сообщения в этом обсуждении
"Помогите отключить для одного домена greylist(exim)"
Отправлено Moomintroll , 22-Сен-11 13:53 

deny condition = ${if eq{${lookup mysql{SELECT email FROM whitelist WHERE email = '$domain'}}}{}{no}{yes}}

Вы, на мой взгляд, производите не вполне корректное сравнение (eq) отсутсвующего результата с пустой строкой.

В то же время lookup сам может вернуть произвольный результат:

${lookup <search type> {<query>} {<string1>} {<string2>}}
....
If the lookup succeeds, <string1> is expanded and replaces the entire item.
....
If the lookup fails, <string2> is expanded and replaces the entire item.

Соответсвенно, стоит попробовать так:


deny condition = ${lookup mysql{SELECT email FROM whitelist WHERE email = '$domain'}{no}{yes}}


"Помогите отключить для одного домена greylist(exim)"
Отправлено bobot , 22-Сен-11 15:40 
>
>
 
> deny condition = ${lookup mysql{SELECT email FROM whitelist WHERE email = '$domain'}{no}{yes}}
>

Тоже самое не работает ((


"Помогите отключить для одного домена greylist(exim)"
Отправлено Moomintroll , 22-Сен-11 16:20 
>>
>>
 
>> deny condition = ${lookup mysql{SELECT email FROM whitelist WHERE email = '$domain'}{no}{yes}}
>>

> Тоже самое не работает ((

А дело не в том, что у Вас в таблице 'email', а ищете Вы '$domain' ?


"Помогите отключить для одного домена greylist(exim)"
Отправлено bobot , 22-Сен-11 16:22 
>>>
>>>
 
>>> deny condition = ${lookup mysql{SELECT email FROM whitelist WHERE email = '$domain'}{no}{yes}}
>>>

>> Тоже самое не работает ((
> А дело не в том, что у Вас в таблице 'email', а
> ищете Вы '$domain' ?

не-а вот


+------------+
| email      |
+------------+
| cisco.com  |
| ua.fm      |
| bigmir.net |
| meta.ua    |
| mail.ru    |
| bk.ru      |
| gmail.com  |
| i.ua       |
+------------+


"Помогите отключить для одного домена greylist(exim)"
Отправлено Moomintroll , 22-Сен-11 16:26 
>> Тоже самое не работает ((
> А дело не в том, что у Вас в таблице 'email', а
> ищете Вы '$domain' ?

Да к тому же, по логике, это должен быть $sender_address_domain ...

When an ACL is running for a RCPT command, $domain contains the domain of the recipient address.

Впрочем, что это я Вам spec пересказываю?... Сами почитайте.