exim4 whitelist and blacklist

Whitelist and blacklist
We all know how beautiful vestacp and hestiacp are. Especially hestiacp :)
Exim4 is installed out of the box, but one little thing is missing - workable blacklist and whitelist.
We all periodically experience the fact that our correctly configured mail servers refuse to accept mail that was incorrectly sent and looks like spam. But sometimes we need to accept this spam from specific mail addresses and servers.
This method allows you to guaranteedly receive mail from addresses, mail domains or IP addresses specified in the whitelist file and guaranteed not to receive mail from addresses, mail domains or IP addresses specified in the blacklist file.
Let's find the acl_check_rcpt: section in /etc/exim4/exim4.conf.template.
I commented out the line # accept hosts = : and added this code after it:

accept hosts = +relay_from_hosts
!authenticated = *
set acl_m6 = whitelisted
accept domains = +local_domains : +relay_to_domains
condition = ${lookup{$sender_address}wildlsearch{/etc/exim4/whitelist}{yes}{no}}
set acl_m6 = whitelisted
logwrite = Accepted from $sender_address to [email protected]$domain by whitelist.
accept domains = +local_domains : +relay_to_domains
hosts = net-lsearch;/etc/exim4/whitelist
set acl_m6 = whitelisted
logwrite = Accepted from $sender_address to $local_par[email protected]$domain by whitelist.
deny condition = ${lookup{$sender_address}wildlsearch{/etc/exim4/blacklist}{yes}{no}}
set acl_m6 = blacklisted
logwrite = Rejected from $sender_address to [email protected]$domain by blacklist.
deny hosts = net-lsearch;/etc/exim4/blacklist
set acl_m6 = blacklisted
logwrite = Rejected from $sender_address to [email protected]$domain by blacklist.

That's all, folks :)