CentOS and Postfix

General support questions
Post Reply
tompark
Posts: 1
Joined: 2019/03/25 15:46:37

CentOS and Postfix

Post by tompark » 2019/03/25 20:24:34

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.

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: CentOS and Postfix

Post by avij » 2019/03/25 20:40:58

I have this in my own config:

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
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.

Post Reply