I have been using sendmail as MTA & SquirrelMail for webmail. I used to have following setup to restrict recepient in SquirrelMail. SquirrelMail had a plugin called Recepientrestrictions which can check two php files
Config.PHP
- contains list of different domains where my domain user can send mails (sysadmins & Directors of company can send mails to anybody)recepientrestrictions.php
- contains list of specific addresses such as user@gmail.com or user1@yahoo.com to whom my domain user can send mail.(again sysadmin & Directors of company can send mails to anybody)
Now the problem is:
I am migrating to Zentyal as email server. Zentyal uses Postfix in background & Roundcube for webmail.
I have got a partial solution which is a general rule for all users in my domain (couldn't seperate sysadmin/ directors to send mail to anybody on internet) which restricts mails delivered to specific domains which is as follows.
Add this into main.cf:
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient_domains, reject
/etc/postfix/recipient_domains
is the whitelist file:mycompany.com OK anotherdomain.com OK
Generate hash file:
postmap /etc/postfix/recipient_domains
- Restart postfix service.
Even after this it doesn't block a mail sent to anybody@gmail.com or anybody@yahoo.com . Also I want to enable sending mail to few mail id's on webmail providers with the help of a whitelist file. e.g.
somebody@gmail.com OK
somebody@yahoo.com OK
foo@gmail.com OK
In short the scheme is :
- Group1 sends mail to anybody on the planet.
- Group2 sends mail thro' two whitelists 1) domain wise 2) specific users of webmail.
Question is how to achieve this scheme?