smtp_accept_max_per_host on a per-IP basis
Should you have a few mail relaying machines/servers that need to be exempt from the smtp_accept_max_per_host value, just do the following:
- open up the /usr/local/atmail/mailserver/configure file
- find:
# # Allow only X connections per IP to the mail-server, spam trap smtp_accept_max_per_host = 5 #
- comment it all out;
- below the line, add:
smtp_accept_max_per_host =
${lookup{$sender_host_address}lsearch{/usr/local/atmail/mailserver/whitelist}
{$value}
{
${lookup{${mask:$sender_host_address/24}}lsearch*{/usr/local/atmail/mailserver/whitelist}}
}}
- create a file called /usr/local/atmail/mailserver/whitelist
- in the file, create the following lines:
192.168.0.0/24: 10
192.168.4.5: 15
*: 5
Where the first item is the IP address/block, punctuated with a colon; the second value being the smtp_accept_max_per_host value you want to assign.
Remember to add a wildcard (*) value to handle all other IP addresses.
- open up /usr/local/atmail/webmnail/libs/Atmail/Exim_Config.php
- find:
smtp_accept_max_per_host = {$pref['smtp_max_connections_perip']}
- change this to:
# smtp_accept_max_per_host = {$pref['smtp_max_connections_perip']}
- restart Apache and @Mail afterwards

