Rajneesh Rana: > hi, > I have setup postfix using virtualmin on ubuntu 16.04 > Have setup DKIM, MX, SPF etc > For webmail have setup roundcube and rainloop. > SSL is setup using let's encrypt. > Everything works great for emails. > > Now we need to restrict some users to be able to send local emails only. > For this I found this http://www.postfix.org/RESTRICTION_CLASS_README.html > and followed steps for Restricting what users can send mail to off-site > destinations > > I have tried all options and searched all options online but none of it > seems to work for this. > > Here's content from my main.cf file > > smtpd_recipient_restrictions = check_sender_access > hash:/etc/postfix/restricted_senders, permit_mynetworks, > permit_sasl_authenticated, reject_unauth_destination, check_policy_service > inet:127.0.0.1:10023, permit_auth_destination, reject > smtpd_restriction_classes = local_only > local_only = check_recipient_access hash:/etc/postfix/local_domains, reject > > >From /etc/postfix/local_domains > domain1.com OK > domain2.com OK > > >From /etc/postfix/restricted_senders > te...@domain1.com local_only > te...@domain1.com local_only > te...@domain1.com local_only > te...@domain1.com local_only > te...@domain1.com local_only > te...@domain1.com local_only > > Once files were added did postmap and service restart for postfix. > > I have tried sending to and from gmail, self hosted, office 365 accounts and > they all work for these test domains. > > > If you have any idea on this that would be really helpful. > All online tutorials only shows same code and no possible solution with it.
Please review the mailing list welcome message: TO REPORT A PROBLEM see http://www.postfix.org/DEBUG_README.html#mail TO (UN)SUBSCRIBE see http://www.postfix.org/lists.html Thank you for using Postfix.