I use Exim MTA. I need to restrict hosting (lamp) send emails only from predefined list "From:" emails per user to prevent massive spam if website was hacked.
Users use php to send emails via builtin function mail();
Eg. user client1 have domain example.org and in cms settings configured to send emails From [email protected]. Any other sender From i need to reject for this user. But users need ability to configure multiple From emails.
How implement this in exim?
Currently i have simple acl to block entire user emails by this ACL:
acl_check_not_smtp:
deny
condition = ${lookup{$sender_ident}lsearch{/etc/exim4/restricted_sender} {yes}}
And /etc/exim4/restricted_sender is simple list of users:
client1
Thanks.