PROBLEM
I need to block sending from my server from specific IP addresses.
ENVIRONMENT
- On-Premise Server + WebMail Installations: Version 6.0 > Current Version
CAUSE
Anti-Spam requirement.
RESOLUTION
- Open and edit
/usr/local/atmail/mailserver/configure
. - Locate:
domainlist dkim_off =
- Add:
hostlist bad_ips = /usr/local/atmail/mailserver/bad_ips
Example:
hostlist bad_ips = /usr/local/atmail/mailserver/bad_ips
domainlist dkim_off = - Locate:
acl_smtp_rcpt = acl_check_rcpt
- Add:
acl_smtp_connect = acl_check_connect
Example:
acl_smtp_connect = acl_check_connect
acl_smtp_rcpt = acl_check_rcpt - Locate:
begin acl
- Add:
acl_check_connect :
Example:
drop
hosts = : +bad_ips
message = Rejected - IP [$sender_host_address:ip] is listed in bad IPs
logwrite = LOG:ACL_CONNECT:REJECT:$sender_host_address:ip $sender_host_address is listed in Bad IPs
accept
begin acl
acl_check_connect :
drop
hosts = : +bad_ips
message = Rejected - IP [$sender_host_address:ip] is listed in bad IPs
logwrite = LOG:ACL_CONNECT:REJECT:$sender_host_address:ip $sender_host_address is listed in Bad IPs
accept - Save changes and exit.
- Create
/usr/local/atmail/mailserver/bad_ips
.
List IP addresses you wish to block. New line for each IP.
Example:
11.11.11.11
22.22.22.22
33.33.33.33 - Restart atmail services for the changes to take affect.
/etc/init.d/atmailserver restart
Comments