N
N
Nikita2019-07-09 18:59:56
Exim
Nikita, 2019-07-09 18:59:56

How to defeat relay not permitted?

Question of the following nature. I set up dovecot and exim, registered all the necessary things in DNS. Mail comes normally, from all addresses. When you try to send to external addresses, an error pops up in the subject. If removed from the config

here

accept hosts = +relay_from_hosts
control = submission
require message = relay not permitted
domains = +local_domains : +relay_to_domains
require verify = recipient
then everything is fine. So I didn't understand how it works. But this way the server becomes open to everyone. How to solve this problem without opening smtp for everyone? And leaving the authorization in place?
acl_check_rcpt

# Начало ACL
begin acl
acl_check_rcpt:
accept hosts = :
deny message = Restricted characters in address
domains = +local_domains
local_parts = ^[.] : ^.*[@%!/|]
deny message = Restricted characters in address
domains = !+local_domains
local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
# Запрещаем подключение к серверу без авторизации
#deny message = SMTP Auth required
# !authenticated = *
deny message = REJECTED - user found.
domains = +local_domains : +relay_to_domains
!verify = recipient/callout=2m,defer_ok,use_sender
accept local_parts = postmaster
domains = +local_domains
require verify = sender
accept hosts = +relay_from_hosts
control = submission
require message = relay not permitted
domains = +local_domains : +relay_to_domains
require verify = recipient
accept

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-07-09
@Extar93

Let's try this. This part

accept hosts = +relay_from_hosts
control = submission
require message = relay not permitted
domains = +local_domains : +relay_to_domains
require verify = recipient

accept

Let's replace it with
accept hosts = +relay_from_hosts
control = submission
domains = +local_domains : +relay_to_domains
verify = recipient

accept  authenticated = *

deny    message =  relay not permitted

So you have authorized users will be accepted to send mail

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question