Blocking outgoing mails to domain for list user in exim

roliks94

Registered
Feb 27, 2019
4
0
1
Latvia
cPanel Access Level
Root Administrator
Hey! I need help! I trying to create custom ACL rule in Exim. I need to block outgoing emails to a certain domain for list user. Below is a description of what I do but the result is not working.

On the e-mail server mail.test.lv is created folder /home/emailrestrict/ there is created a restrictedtests file, which contains e-mail addresses which need to limit.

In restrictedtests file is line per line written email: [email protected] [email protected]

Next i open Exim Configuration Manager/Advanced Editor and select BEGINACL and in this section, I add this:

acl_emailrestrict_restrictedtests:
deny condition = $ {lookup {$ sender_address} nwildlsearch {/ home / emailrestrict / restrictedtests} {yes}}
domains =!

acl_smtp_rcpt = acl_smtp_rcpt

acl_check_rcpt:

deny
message = The $ sender_address is prohibited to send mail to the $ domain
senders = lsearch; / home / emailrestrict / restricted_sender
domains = lsearch; / home / emailrestrict / restricted_domains

If this records correct? Or I need to change it, or create different configuration? Myb some have already creat example like I need to create?

Already Thanks!
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463