limit incoming or receiving email rate with Postfix

smtpd_error_sleep_time - The SMTP server response delay after a client has made more than $smtpd_soft_error_limit errors, and fewer than smtpd_hard_error_limit errors, without delivering mail.

smtpd_soft_error_limit : The number of errors a remote SMTP client is allowed to make without delivering mail before the Postfix SMTP server slows down all its responses.

smtpd_hard_error_limit : The maximal number of errors a remote SMTP client is allowed to make without delivering mail. The Postfix SMTP server disconnects when the limit is exceeded.

Edit main.cf and add:
smtpd_error_sleep_time = 1s
smtpd_soft_error_limit = 10
smtpd_hard_error_limit = 20

Postfix waits one second before each error such as HELO command not provided or FQDN hostname does not exists etc After 10 such errors postfix will start to increase delay. If error limits touches 20 Postfix will disconnect client.
You can see this in action from /var/log/maillog file:

Dec 15 16:50:59 server postfix/anvil[20799]: statistics: max connection rate 1/60s for (smtp:ip goes here) at Dec 15 16:47:29
Dec 15 16:50:59 server postfix/anvil[20799]: statistics: max connection count 1 for (smtp:ip goes here) at Dec 15 16:47:29
Dec 15 16:50:59 server postfix/anvil[20799]: statistics: max cache size 2 at Dec 15 16:47:38

 

Was this answer helpful?

 Print this Article

Also Read

How do I block an IP address from my Linux Dedicated Hosting Server?

If you want to block access to your linux dedicated hosting server for whatever reason, you will...

Limit SSH access using APF

APF firewall can deny ALL connections for ssh and allow only a single or select few of IPs to...

Web Security Best Practices when using SuPHP

Whilst using any shared hosting environment it is important to consider the practices you are...

Force browsers to use SSL

RewriteEngine on Options +FollowSymlinks #Rewrite the URL for myapp to always use https except...

How to remove apf firewall

Execute the following commands: # service iptables stop# chkconfig apf off# rm -rfv /etc/apf# rm...