Hi,
What I am trying to do is to restrict outgoing emails for a group of mailboxes. Let’s say that an organization has a group of employees called, Developers. Now tom@example.con, dik@example.com and harry@example.com are the member of this group. These three people can only send email to other mailboxes against example.com. They can’t send email to any other domain to outside world.
I can’t do this configuration in core postfix. The configuration as follows.
We can create a file called /etc/postfix/restricted_senders. The content of the file is given below.
tom@example.com local_only
dik@example.com local_only
harry@example.com local_only
Now run the command postmap /etc/postfix/restricted_senders to create Postfix usable file.
Now the configuration of /etc/postfix/main.cf is as follows
smtpd_recipient_restrictions =
check_recipient_access hash:/etc/postfix/recipient_access,
reject_unverified_recipient,
reject_unauth_pipelining,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
check_sender_access hash:/etc/postfix/restricted_senders,
These local users are allowed to send email to local users only
smtpd_restriction_classes = local_only
local_only =
check_recipient_access hash:/etc/postfix/local_domains,
reject
The above configuration is working well in core postfix mail server. But I can’t implement it in Mailcow server. Specially for the postmap command. Postmap command is not working. My postmap command as follows.
docker exec -it $(docker ps -f name=mysql-mailcow -q) postmap /opt/mailcow-dockerized/data/conf/postfix/restricted_senders
The above command giving error postmap: fatal: open /opt/mailcow-dockerized/data/conf/postfix/restricted_senders: No such file or directory
. Though my given file path correct and I can edit that file using nano editor. Can anyone help?