четверг, 31 января 2013 г.

exim ratelimit


С форума лиссяры:


acl_not_smtp = acl_check_not_smtp

 .....

acl_check_not_smtp:
        warn  ratelimit = ${lookup{$sender_address_local_part}lsearch*{/etc/exim4/userwhitelist}} / 1h / strict / $sender_address_local_part
        log_message     = Sender rate $sender_rate / $sender_rate_period

        condition      = ${if !match_local_part{$sender_address_local_part}{lsearch;/etc/exim4/userwhitelist} {yes}{no}}

        deny    message    = Sender rate overlimit - $sender_rate / $sender_rate_period
        ratelimit       = ${lookup{$sender_address_local_part}lsearch*{/
etc/exim4/userwhitelist}} / 1h / strict / $sender_address_local_part
         condition      = ${if !match_local_part{$sender_address_local_part}{lsearch;/etc/exim4/userwhitelist} {yes}{no}}

accept

.....

acl_smtp_rcpt = acl_check_rcpt

.....

  warn    authenticated   = *
          ratelimit       = ${lookup{$authenticated_id}lsearch*{/etc/exim4/userwhitelist}} / 1h / strict / $authenticated_id
          log_message     = Authenticated sender rate $sender_rate / $sender_rate_period

           condition       = ${if !match_local_part{$authenticated_id}{lsearch;/etc/exim4/userwhitelist} {yes}{no}}

  deny    authenticated   = *
          ratelimit       = ${lookup{$authenticated_id}lsearch*{/etc/exim4/userwhitelist}} / 1d / strict / $authenticated_id
          log_message     = Authenticated sender rate $sender_rate / $sender_rate_period

           condition       = ${if !match_local_part{$authenticated_id}{lsearch;/etc/exim4/userwhitelist} {yes}{no}}

------------------------------------------

thanatos:/usr/sbin# cat /etc/exim4/userwhitelist
# limits messages per day

# system users
root:                   10000
mailnull:               10000

# some users
www-data@domain.ru:     100

# limit for all undefined users
*:                      200





или по простецки:



begin acl

        acl_not_smtp:
                deny message = Sender rate overlimit - $sender_rate / $sender_rate_period
                ratelimit = 50 / 1h / leaky
                accept

        acl_check_rcpt:
                deny message = Sender rate SMTP overlimit - $sender_rate / $sender_rate_period
                ratelimit = 100 / 1h / leaky

                accept  hosts = net-lsearch;/etc/exim/whitelist



 в /etc/exim/whitelist список хостов.

Комментариев нет: