I want exim to accept messages only from that user which authorized via SMTP. Now I have these lines in the config:
accept
authenticated = *
sender_domains = +local_domains
control = submission/sender_retain
control = dkim_disable_verify
deny
message = Unauthorized
sender_domains = +local_domains
!authenticated = *
It makes that any authorized user can send messages from local domains. For example, I have two domains: local1.com and local2.com and users user1 and user2 (suggest that both of domains have these users). If I authenticate as [email protected] I can MAIL FROM: [email protected] and even [email protected]. But I want to deny any different users even if they are local. Only [email protected] must be accepted.
During authentication user's credentials are stored in the
$auth1
,$auth2
and$auth3
variables. More specifically,$auth1
contains user's login in form [email protected]. So you have just verify whether that login is equal to the$sender_address
: