Hi Guys,
I am currently setting up a new mail server on CentOS using Postfix, I am trying to restrict the 'sender' domain to only allow authenticated domains to send externally. I have tried following a few guides online and can't seem to get it to work correctly. It keeps allow me to send what ever I like through the SMTP Server. Does anyone have any suggestions?
Below is an example of what I am trying to setup.
Domains: example.com
Mail Server: LinuxMail
I would like external users to be able to send emails to example.com mailboxes
I would like only example.com users (authenticated) to be able to send email to external domains (outlook.com, gmail.com etc).
http://www.postfix.org/SMTPD_ACCESS_README.html
Any help or suggestions would be apricated.
CentOS and Postfix
Re: CentOS and Postfix
I have this in my own config:
where permit_sasl_authenticated and reject_unauth_destination are probably the most important ones for this purpose. Depending on your use case you may not want/need permit_mynetworks.
In addition you'll need to set up auth, but I guess you have it set up already. Mine has smtpd_sasl_type = dovecot and a few related parameters to use dovecot as the authentication method.
Code: Select all
smtpd_recipient_restrictions =
check_sender_access hash:/etc/postfix/sender_access,
reject_unknown_recipient_domain,
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
check_client_access hash:/etc/postfix/rbl_whitelist,
check_policy_service unix:postgrey/socket,
reject_rbl_client blacklist1.example.com,
reject_rbl_client blacklist2.example.com,
reject_rbl_client blacklist3.example.com,
permit
In addition you'll need to set up auth, but I guess you have it set up already. Mine has smtpd_sasl_type = dovecot and a few related parameters to use dovecot as the authentication method.