2

I have around 2000 email accounts. How can I configure postfix in a way that some users can send/receive email to/from the internet and others not. I am following this manual to restrict sending so far http://www.postfix.org/RESTRICTION_CLASS_README.html#external

/etc/postfix/main.cf:    
smtpd_recipient_restrictions =  check_sender_access hash:/etc/postfix/restricted_senders,
                                check_recipient_access hash:/etc/postfix/blacklist,
                                reject_unauth_pipelining,
                                reject_non_fqdn_sender,
                                reject_non_fqdn_recipient,
                                reject_unknown_sender_domain,
                                reject_unknown_recipient_domain,
                                permit_mynetworks,
                                permit_sasl_authenticated,
                                reject_unauth_destination,
                                check_client_access hash:/etc/postfix/rbl_override,
                                reject_rbl_client cbl.abuseat.org,
                                reject_rbl_client sbl-xbl.spamhaus.org,
                                ....
                                check_policy_service inet:127.0.0.1:10023,
                                permit
smtpd_restriction_classes =     local_only
local_only                =     check_recipient_access hash:/etc/postfix/local_domains, reject

/etc/postfix/restricted_senders:                    
user1@mydomain.com             local_only
user2@mydomain.com             local_only

/etc/postfix/local_domains:
mydomain.com                OK
mysubdomain.mydomain.com    OK

I run postmap command:

postmap /etc/postfix/restricted_senders
postmap /etc/postfix/local_domains

Restarted the postfix service.

Using this setting, user1@mydomain.com should not be able to send email to any email address expect mydomain.com (Correct me if I'm wrong).

I used web based client and sent email from user1@mydomain.com to gmail, yahoo, etc and gmail, yahoo users could receive from user1@mydomain.com.

what is wrong here?

  • I just found out that that setting is working when I send email using Thunderbird (571 access denied, it worked), but when I try to send email using Roundcube (web based client), the setting is not working. Is there any possibility to make it work on Roundclube as well? – Abdu Nov 1 '16 at 11:33
  • What do the mail logs show for mail from thunderbird vs. what roundcube sends? – thrig Nov 1 '16 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.