Faruque Ahmed : MCP, MCSA, MCSE, MCTS, MCIT, CCNA, OCA, OCP, GCP
# apt install policyd-rate-limit
default_limit: This sets the default rate limit for all users. Here, it allows 100 emails per hour (100/1h).
# vi /etc/postfix/main.cf
# systemctl restart postfix policyd-rate-limit
# vi /etc/policyd-rate-limit.conf
# systemctl restart policyd-rate-limit
Use the policyd-rate-limit command-line tool to check the current rate limits and usage:
# policyd-rate-limit-cli stats
postfix-policyd is a policy daemon that helps enforce rate limits.
Enable and start the service:
Edit the configuration file:
Find the [limits] section and set the hourly email limit:
Ensure sender tracking is enabled:
Save and exit (Ctrl + X, then Y, then Enter).
Restart postfix-policyd:
systemctl restart postfix-policydEdit the Postfix main configuration file:
nano /etc/postfix/main.cfFind and modify smtpd_recipient_restrictions:
Save the file and restart Postfix:
systemctl restart postfixCheck the mail logs to ensure emails are being throttled:
sudo tail -f /var/log/mail.log