Rate limit exim per user basis

eximrate-limitingsmtp

How can I implement "rate limit" in Exim so that every user in my exim can send specific number of emails per day.

List A of Users can send 100 emails per day and the list B of users can send 500 emails per day.

Best Answer

Expanding on HBruijn's answer, I recommend this ACL segment:

# 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

Then you create the /etc/exim/send_limits file and have this in there:

# Commented lines and blank lines are ignored
# Format is     EMAIL: LIMIT
user1@domain1.com: 100
user2@domain1.com: 200
user3@domainXX.com: 100

# Must be the last line, this is the default limit
*@*: 50

This is untested, but it should get you headed in the right direction.