You will need to edit exim.conf file (originally located in /etc/exim.conf), but to retain changes after update, create custom one: https://help.directadmin.com/item.php?id=51
if ("$header_to:, $header_cc:" contains "@yahoo.com")
then
fail text "Email to this mail address is temporarily blocked by the Administrator"
seen finish
endif
I want to block some users to sending out mails to other domains in Exim4. I tried the following configuration but did not work. Changes done in exim.conf file: In the main configuration section,