Topic: How to prevent some mail users to send email out of iredmail domains
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.7 MARIADB edition
- Linux/BSD distribution name and version: Centos7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx): apache
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
Good day, i have 3 domains handled by iredmail (@domain1.com, @domain2.com, @domain1.local)
i wish only 2 users of @domain1.local not able to send email to anyone out of @domain1.com, @domain2.com and @domain1.local.
so ralph@domain1.local can send to *@domain1.com, *@domain2.com, *@domain1.local
but not to any other.
NOTE @domain1.local, use only webinterface cause .local have not imap or pop3/smtp.
To do this i found on your forum something and i tried :
nano /etc/postfix/main.cf
*find the section:
smtpd_recipient_restrictions =
*add this line at the very top:
check_sender_access hash:/etc/postfix/sender_access,
*Save and close
then create file:
nano /etc/postfix/sender_access
*insert inside:
ralph@domain1.local {TAB} REJECT You're not allowed to send email by this address.
*save and close, then:
postmap /etc/postfix/sender_access
service postfix reload
Then i tried also to edit mailbox
UPDATE vmail.mailbox SET allowedrecipients='@domain1.com,@domain2.com,@domain1.local', rejectedrecipients='@.' WHERE username='ralph@domain1.local';
but both doesn't work, it keep sending to anyone.
i did not reboot the whole server. maybe it's needed to refresh those edits?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.