O
O
Oleg Svirchev2014-08-06 12:57:17
linux
Oleg Svirchev, 2014-08-06 12:57:17

How to prevent exim from sending emails to yahoo, hotmail, etc.?

Unfortunately, I often encounter spam and it is not always possible to prevent the mailing of letters from hacked sites in time, which subsequently causes IPs to be blacklisted.
Tell me, what should be created correctly in the Exim mail system so that mailing via smtp and php mail cannot reach certain recipients, for example, yahoo.com, hotmail, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Opaspap, 2014-08-07
@svirchoff

In the dnslookup router or which one you use for external connection (for example, I have smarthost), add a line like this:
in the main section, write
This will prevent routing to unwanted domains
. You can additionally set it in the acl section:

acl_not_smtp:
  drop
        condition = ${if forany{<, $recipients}\
                {bool{${lookup{${domain:$item}}lsearch{/etc/exim4/unwanted_domains}{1}{0}}}}}
        message = not allowed
  accept

and don't forget to add to main
this will cause exim to throw an error when sending locally with mail
put your domains in the /etc/exim4/unwanted_domains file one per line
all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question