Mail rate limiting

Hi,
How can I automatically set mail rate limiting, depending on plan?
Say, “Basic” plan limits 10 messages a day, “Advanced” - 100, etc. Trying to control the potential spam.

Please advice. I would really appreciate. I can try to return the favor :wink:

Solved it on my own. Not the best solution, but does the job.

/etc/mail/greylist.conf

Limits 50 messages per 12 hours per user

ratelimit “virtualmin_limit” rcpt 50 / 720m key “%f”

racl greylist from /.*/ ratelimit “virtualmin_limit” delay 721m autowhite 0m msg “Message quota exceeded”

racl whitelist default