我怎样才能在Exim中实现“速率限制”,让我的每个用户每天都能发送特定数量的邮件。
用户列表A每天可以发送100封电子邮件,用户列表B每天可以发送500封电子邮件。
扩展HBruijn的答案,我推荐这个ACL段:
# Keep authenticated users under control deny authenticated = * set acl_c_msg_limit=${lookup{$sender_address}nwildlsearch{/etc/exim/send_limits}} ratelimit = $acl_c_msg_limit / 1d / strict / $authenticated_id
然后你创build/ etc / exim / send_limits文件,并在这里:
# Commented lines and blank lines are ignored # Format is EMAIL: LIMIT [email protected]: 100 [email protected]: 200 [email protected]: 100 # Must be the last line, this is the default limit *@*: 50
这是未经testing的,但它应该让你朝着正确的方向前进。
该手册有一个基于用户的速率限制设置的configuration示例:
# Keep authenticated users under control deny authenticated = * ratelimit = 100 / 1d / strict / $authenticated_id
这限制了authentication的发件人每天100封邮件,但对于所有经过validation的用户来说,这也是全球性的。