[exim] Configuring rate limiting on a per router basis

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Cameron Harris
Dátum:  
Címzett: Exim-users
Tárgy: [exim] Configuring rate limiting on a per router basis
Hello all,

I'm using exim 4.72, under Debian squeeze. I've been working on creating
routers that will add additional headers to our messages based on which
router they pass through. I however would like to create rate limiting
conditions that make decisions based on these added headers. How would I go
about configuring a ratelimit based on which router my message passes
through? Is it possible to create acl's within my routers or to set rules
that specify what acl to hit after passing through a router? Thanks in
advance, I have not be able to find a plentiful amount of documentation on
exim's ratelimit feature.


here's a snip it of my conf.d/routers/02_server_routers

.ifdef DCconfig_internet
# configtype=internet
#
# deliver mail to the recipient if recipient domain is a domain we
# relay for. We do not ignore any target hosts here since delivering to
# a site local or even a link local address might be wanted here, and if
# such an address has found its way into the MX record of such a domain,
# the local admin is probably in a place where that broken MX record
# could be fixed.

server_dnslookup_relay_to_domains:
debug_print = "R: dnslookup_relay_to_domains for $local_part@$domain"
driver = dnslookup
domains = ! +local_domains : +relay_to_domains
transport = server_remote_smtp
same_domain_copy_routing = yes
pass_on_timeout
fallback_hosts = SERVER_SMARTHOST


# deliver mail directly to the recipient. This router is only reached

# for domains that we do not relay for. Since we most probably can't

# have broken MX records pointing to site local or link local IP
# addresses fixed, we ignore target hosts pointing to these addresses.


server_mailout: debug_print = "R: server_mailout for $local_part@$domain
for $sender_address_domain"                                driver =
manualroute
 domains = ! +local_domains transport = server_remote_smtp
 condition = ${if !eq{}{${extract{id_hash}{${lookup
mysql{SERVER_MAILOUT}}}}}} headers_add = X-PT-INTERNAL-ID:
${extract{id_hash}{${lookup mysql{SERVER_MAILOUT}}}}


 route_data = ${extract{mailserver}{${lookup mysql{SERVER_MAILOUT}}}}
                                        server_dnslookup:  debug_print =
"R: server_dnslookup for $local_part@$domain"


  driver = dnslookup
  domains = ! +local_domains  transport = server_remote_smtp
  #If our message passes through this router, tag with our internal id
 headers_add = X-PT-INTERNAL-ID: ${extract{id_hash}{${lookup
mysql{SERVER_MAILOUT}}}}{code}
  same_domain_copy_routing = yes  # ignore private rfc1918 and APIPA
addresses
  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :\
             172.16.0.0/12 : 10.0.0.0/8 : 169.254.0.0/16 :\


                        255.255.255.255
                                           pass_on_timeout
  fallback_hosts = SERVER_SMARTHOST


server_smarthost: debug_print = "R: server_smarthost for $local_part@$domain"

driver = manualroute domains = ! +local_domains
route_list = !+local_domains SERVER_SMARTHOST

transport = server_remote_smtp
no_more
.endif