Sorry about the confusion, i need some time to write the document.
As a temporary solution, please read the comment lines in iRedAPD plugin file, i hope it's clear for you.
*) Throttle: https://bitbucket.org/zhb/iredapd/src/d … hrottle.py
# Usage
# -------------
#
# *) Enable iRedAPD in Postfix parameters: `smtpd_recipient_restrictions` and
# `smtpd_end_of_data_restrictions`. For example:
#
# # Check max_msgs
# smtpd_recipient_restrictions =
# ...
# check_policy_service inet:[127.0.0.1]:7777
# permit_mynetworks
# ...
#
# # Check msg_size and max_quota
# smtpd_end_of_data_restrictions =
# check_policy_service inet:[127.0.0.1]:7777
# ...
#
# *) Enable this plugin in iRedAPD config file /opt/iredapd/settings.py.
# *) Restart both iRedAPD and Postfix services.
# Technical details
# -------------
#
# Currently you may throttle based on:
#
# - amount of mails sent over a given period of time
# - accumulated mail size sent over a given period of time
# - size of singe message
#
# Eg: You can enforce that user@domain.com does not send more than 1000 mails
# or 1GB of mail (whichever limit is hit first) in 5 minute.
#
# Possible throttling address:
#
# *) Full email address: user@domain.com
# *) Domain name (with a prefixed '@'): @domain.com
# *) Sub-domain name (with a prefixed '@.'): @.domain.com
# *) IP address: 192.168.1.1
# *) IP network: 192.168.1.*
# *) Catch-all for email address: '@.' (note, the dot is required)
# *) Catch-all for IP address: '@ip'
#
# Priorities of different thorttle address (larger digital number has higher priority):
#
# *) email: 100 # e.g. 'user@domain.com'. Highest priority
# *) wildcard_addr: 90 # e.g. `user@*`. used in plugin `amavisd_wblist`
# # as wildcard sender. e.g. 'user@*`
# *) ip: 80 # e.g. 173.254.22.21
# *) wildcard_ip: 70 # e.g. 173.254.22.*
# *) cidr: 70 # e.g. 173.254.22.0/24
# *) domain: 60 # e.g. @domain.com
# *) subdomain: 50 # e.g. @.domain.com
# *) top_level_domain: 40 # e.g. @com, @org
# *) catchall: 0 # '@.'. Lowest priority
# ------------
# Valid throttle settings:
#
# * msg_size: max size of single message
# * max_msgs: max number of sent messages
# * max_quota: max number of accumulated message size
#
# Valid values for throttle settings:
#
# * XX (an integer number): explicit limit. e.g. 100. for example, set
# `max_msgs=100` means user can send/receive up to 100 messages.
# * 0: (explicit) unlimited.
# * -1: inherit setting which has lower priority. for example, set
# `msg_size=-1` for user `user@domain.com` will force iRedADP to check
# `msg_size` setting in per-domain (`@domain.com`) and/or global (`@.`)
# throttle settings.
#
# ------------
# Sample sender throttle settings:
#
# *) Allow user `user@domain.com` to send in 6 minutes (period=360):
#
# * max size of single message is 10240000 bytes (msg_size)
# * max 100 messages (max_msgs)
# * max 4096000000 bytes (max_quota)
#
# INSERT INTO throttle (account, kind, priority, period, msg_size, max_msgs, max_quota)
# VALUES ('user@domain.com',
# 'outbound',
# 10,
# 360,
# 10240000,
# 100,
# 4096000000);
#
# Sample recipient throttle settings:
#
# *) Allow user 'user@domain.com' to receive in 6 minutes (period=360):
#
# * max size of single message is 10240000 bytes (msg_size)
# * max 100 messages (max_msgs)
# * max 4096000000 bytes (max_quota)
#
# INSERT INTO throttle (account, kind, priority, period, msg_size, max_msgs, max_quota)
# VALUES ('user@domain.com',
# 'inbound',
# 10,
# 360,
# 10240000,
# 100,
# 4096000000);
#
#-------------