1

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.

2

Re: How to prevent some mail users to send email out of iredmail domains

- The SQL columns you used are not used by iRedMail any more, so it's expected that it doesn't work.
- You should use white/blacklist instead for this purpose. FYI: https://docs.iredmail.org/manage.iredapd.html

If you have iRedAdmin-Pro, it's easy to manage them:
https://docs.iredmail.org/images/iredadmin/user_profile_wblist.png

3

Re: How to prevent some mail users to send email out of iredmail domains

i have not Pro version, there is another way plz to achieve this?
tnx

4

Re: How to prevent some mail users to send email out of iredmail domains

Sure, i mentioned the tutorial in previous reply:

- You should use white/blacklist instead for this purpose. FYI: https://docs.iredmail.org/manage.iredapd.html

5

Re: How to prevent some mail users to send email out of iredmail domains

ops sorry! didnt noticed. i'll try to do it alone. in case it's hard i will ask u again and for sure i will offer you 3 coffee smile