Quantcast
Channel: iRedMail — iRedMail Support
Viewing all articles
Browse latest Browse all 43290

Re: Block out-of-domain email for certain users

$
0
0

Try either one:

1) iRedAPD (our postfix policy server) has plugin "sql_user_restrictions " for this kind of restriction. What you need to do is enabling this plugin in iRedAPD (/opt/iredapd/settings.py), then updating SQL records of these users (trn_*) with proper restrictions. Let's take user 'trn_1@domain.com' for example:

mysql> USE vmail;
mysql> UPDATE mailbox SET allowedrecipients='@domain.com', rejectedrecipients='@' WHERE username='trn_1@domain.com';

That's all. It means user 'trn_1@' cannot sent email to others except domain 'domain.com'. You can find valid value of those columns in plugin source file (/opt/iredapd/plugins/sql_user_restrictions.py).

2) Write a simple plugin for iRedAPD to check sender/recipient address, reject if not sent to same domain. It should be really simple, i guess you can get it done with 20 lines. Sample plugin: https://bitbucket.org/zhb/iredapd/src/d … at=default


Viewing all articles
Browse latest Browse all 43290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>