exim check outgoing sender domain

vi /etc/localdomains
domaina.com
domainb.com

vi /etc/exim/exim.conf
domainlist sender_domains = lsearch;/etc/localdomains

acl_check_rcpt:

accept hosts = +relay_from_hosts
sender_domains = +sender_domains
control = submission
control = dkim_disable_verify

accept hosts = +relay_from_hosts
sender_domains = +sender_domains
control = submission
control = dkim_disable_verify

require message = bad sender domain
domains = +sender_domains

tail -f /var/log/exim/main.log
2020-05-20 20:55:55 H=mail.server.com [xx.xx.xx.xx] F=<> rejected RCPT : bad sender domain
2020-05-20 20:55:55 H=mail.server.com [xx.xx.xx.xx] F=<> rejected RCPT : bad sender domaim

Leave a Reply

Your email address will not be published. Required fields are marked *