Страница 1 из 1

как отключить greylist для определённых пользователей

Добавлено: 2011-09-08 13:36:32
bobot
У меня Exim+greylist

казалось что легко делается

вот макросы в начале конфига exim

Код: Выделить всё

GREYLIST_INITIAL_DELAY = 1 MINUTE
GREYLIST_INITIAL_LIFETIME = 4 HOUR
GREYLIST_WHITE_LIFETIME = 36 DAY
GREYLIST_BOUNCE_LIFETIME = 0 HOUR
# you can change the table names
GREYLIST_TABLE=exim_greylist
#GREYLIST_LOG_TABLE=exim_greylist_log
GREYLIST_ENABLED=
Я поставил

Код: Выделить всё

GREYLIST_ENABLED=no
Всё равно работает........((((
А сделал так

Код: Выделить всё

#GREYLIST_ENABLED=
Закометил просто .....да не работает
мне надо чтоб юзер сам мог отключать его

я хотел связать
GREYLIST_ENABLED= с мускулом .... ну типа значение yes и no , а оно не реагирует никак что ез что но !!!!!! Всё равно работает... как мне бЫть ?

Re: как отключить greylist для определённых пользователей

Добавлено: 2011-09-08 15:21:07
vadim64
1. где вся остальная инфа? конфиг как минимум
2. вы бы могли вопрсоы по одной тематике в одной теме задавать, а не на каждый вопрос делать новый тред.

Re: как отключить greylist для определённых пользователей

Добавлено: 2011-09-08 15:39:03
bobot
vadim64 писал(а):1. где вся остальная инфа? конфиг как минимум
2. вы бы могли вопрсоы по одной тематике в одной теме задавать, а не на каждый вопрос делать новый тред.
вот сам greylist

Код: Выделить всё

GREYLIST_INITIAL_DELAY = 1 MINUTE
GREYLIST_INITIAL_LIFETIME = 4 HOUR
GREYLIST_WHITE_LIFETIME = 36 DAY
GREYLIST_BOUNCE_LIFETIME = 0 HOUR
# you can change the table names
GREYLIST_TABLE=exim_greylist
#GREYLIST_LOG_TABLE=exim_greylist_log

# comment out to the following line to disable greylisting (temporarily)
GREYLIST_ENABLED=
#GREYLIST_ENABLED

# uncomment the following to enable logging
#GREYLIST_LOG_ENABLED=

# below here, nothing should normally be edited

.ifdef GREYLIST_ENABLED
# database macros
GREYLIST_TEST = SELECT CASE \
   WHEN now() > block_expires THEN "accepted" \
   ELSE "deferred" \
 END AS result, id \
 FROM GREYLIST_TABLE \
 WHERE (now() < record_expires) \
   AND (sender      = '${quote_mysql:$sender_address}' \
        OR (type='MANUAL' \
            AND (    sender IS NULL \
                  OR sender = '${quote_mysql:@$sender_address_domain}' \
                ) \
           ) \
       ) \
   AND (recipient   = '${quote_mysql:$local_part@$domain}' \
        OR (type = 'MANUAL' \
            AND (    recipient IS NULL \
                  OR recipient = '${quote_mysql:$local_part@}' \
                  OR recipient = '${quote_mysql:@$domain}' \
                ) \
           ) \
       ) \
   AND (relay_ip    = '${quote_mysql:$sender_host_address}' \
        OR (type='MANUAL' \
            AND (    relay_ip IS NULL \
                  OR relay_ip = substring('${quote_mysql:$sender_host_address}',1,length(relay_ip)) \
                ) \
           ) \
       ) \
 ORDER BY result DESC LIMIT 1

GREYLIST_ADD = INSERT INTO GREYLIST_TABLE \
  (relay_ip, sender, recipient, block_expires, \
   record_expires, create_time, type) \
 VALUES ( '${quote_mysql:$sender_host_address}', \
  '${quote_mysql:$sender_address}', \
  '${quote_mysql:$local_part@$domain}', \
  DATE_ADD(now(), INTERVAL GREYLIST_INITIAL_DELAY), \
  DATE_ADD(now(), INTERVAL GREYLIST_INITIAL_LIFETIME), \
  now(), \
  'AUTO' \
)

GREYLIST_DEFER_HIT = UPDATE GREYLIST_TABLE \
                     SET blockcount=blockcount+1 \
                     WHERE id = $acl_m9

GREYLIST_OK_COUNT = UPDATE GREYLIST_TABLE \
                    SET passcount=passcount+1 \
                    WHERE id = $acl_m9

GREYLIST_OK_NEWTIME = UPDATE GREYLIST_TABLE \
                      SET record_expires = DATE_ADD(now(), INTERVAL GREYLIST_WHITE_LIFETIME) \
                      WHERE id = $acl_m9 AND type='AUTO'

GREYLIST_OK_BOUNCE = UPDATE GREYLIST_TABLE \
                     SET record_expires = DATE_ADD(now(), INTERVAL GREYLIST_BOUNCE_LIFETIME) \
                     WHERE id = $acl_m9 AND type='AUTO'

#GREYLIST_LOG = INSERT INTO GREYLIST_LOG_TABLE \
#               (listid, timestamp, kind) \
#               VALUES ($acl_m9, now(), '$acl_m8')

.endif

.
.
.
.ifdef GREYLIST_ENABLED
greylist_acl:
  # 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
.
.
.
.ifdef GREYLIST_ENABLED
    defer hosts         = !+relay_from_hosts
         !authenticated = *
         !senders       = : postmaster@* : Mailer-Daemon@*
         acl            = greylist_acl
         message        = GreyListed: please try again later
   .endif

.
.
.
.
.
.
.


.ifdef GREYLIST_ENABLED
    defer hosts         = !+relay_from_hosts
        senders         = : postmaster@* : Mailer-Daemon@*
        acl             = greylist_acl
        message         = GreyListed: please try again later
  .endif