iredmail-doc/html/per-user.send.receive.restr...

87 lines
4.4 KiB
HTML
Raw Normal View History

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2015-12-23 04:10:41 -06:00
<title>[DEPRECATED] Per-user outbound restrictions</title>
<link rel="stylesheet" type="text/css" href="./css/markdown.css" />
</head>
<body>
<div id="navigation">
<a href="/index.html" target="_blank">
<img alt="iRedMail web site"
src="./images/logo-iredmail.png"
style="vertical-align: middle; height: 30px;"
/>&nbsp;
<span>iRedMail</span>
</a>
2016-02-29 02:15:19 -06:00
&nbsp;&nbsp;//&nbsp;&nbsp;<a href="./index.html">Document Index</a></div><h1 id="deprecated-per-user-outbound-restrictions">[DEPRECATED] Per-user outbound restrictions</h1>
2016-01-18 09:38:24 -06:00
<p><strong>WARNING: THIS DOCUMENT IS <em>DEPRECATED</em>, PLEASE DO NOT APPLY IT.</strong></p>
2015-06-26 20:50:52 -05:00
<h2 id="sql-backends">SQL backends</h2>
<p>iRedAPD (a simple Postfix policy server developed by iRedMail team) provides
2015-06-26 20:50:52 -05:00
plugin <code>sql_user_restrictions</code> for per-user inbound/outbound restrictions.</p>
<p>Please make sure plugin <code>sql_user_restrictions</code> is enabled in iRedAPD config
file <code>/opt/iredapd/settings.py</code> like below:</p>
2015-06-26 20:50:52 -05:00
<pre><code class="python"># Part of file: /opt/iredapd/settings.py
plugins = [..., 'sql_user_restrictions']
</code></pre>
<p>Restarting iRedAPD service is required if you modified <code>/opt/iredapd/settings.py</code>.</p>
2015-06-26 20:50:52 -05:00
<p>You can store allowed or disallowed recipient in 2 SQL columns in <code>vmail</code> database:</p>
<ul>
<li><code>mailbox.rejectedrecipients</code>: disallow user to send email to listed recipients.</li>
<li><code>mailbox.allowedrecipients</code>: allow user to send email to listed recipients.</li>
</ul>
<p>Valid sender/recipient formats are:</p>
<ul>
<li><code>@.</code>: all addresses (user, domain, sub-domain). Be careful: There's a dot after <code>@</code>.</li>
<li><code>@domain.com</code>: entire domain.</li>
<li><code>@.domain.com</code>: entire domain and all its sub-domains. Be careful: There's a dot after <code>@</code>.</li>
<li><code>user@domain.com</code>: single email address</li>
2015-01-31 04:20:42 -06:00
<li>empty value means no restriction.</li>
</ul>
2015-06-26 20:50:52 -05:00
<p>NOTE: Multiple recipients must be separated by comma (<code>,</code>).</p>
<p>Sample usage:</p>
<ul>
2015-06-26 20:50:52 -05:00
<li>allow local mail user <code>user@example.com</code> to send to domain (<code>example.com</code>)
and <code>gmail.com</code>, but not others.</li>
</ul>
<pre><code class="sql">sql&gt; USE vmail;
sql&gt; UPDATE mailbox
SET
2015-06-26 20:50:52 -05:00
rejectedrecipients='@.',
allowedrecipients='@example.com,@gmail.com'
WHERE
username='user@example.com';
</code></pre>
<h2 id="openldap-backend-special">OpenLDAP backend special</h2>
<p>OpenLDAP backend requires iRedAPD plugin <code>ldap_amavisd_block_blacklisted_senders</code>.</p>
<ul>
<li>
<p>If you have iRedAdmin-Pro, you can manage this restriction in user profile page.</p>
</li>
<li>
<p>If you don't have iRedAdmin-Pro, you can manage it with phpLDAPadmin or other
LDAP management tools. Related LDAP attributes are:</p>
<ul>
<li><code>mailWhitelistRecipient</code>: same as SQL <code>mailbox.allowedrecipients</code></li>
<li><code>mailBlacklistRecipient</code>: same as <code>mailbox.rejectedrecipients</code></li>
</ul>
</li>
</ul>
2015-06-26 20:50:52 -05:00
<p>Values for these LDAP attributes use the same format as mentioned above.</p>
<p>Note: multiple recipients must be stored in multiple attributes like below:</p>
<pre><code>mailWhitelistRecipient: @example.com
mailWhitelistRecipient: @gmail.com
mailWhitelistRecipient: @iredmail.org
</code></pre><p style="text-align: center; color: grey;">All documents are available in <a href="https://bitbucket.org/zhb/iredmail-docs/src">BitBucket repository</a>, and published under <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">Creative Commons</a> license. You can <a href="https://bitbucket.org/zhb/iredmail-docs/get/tip.tar.bz2">download the latest version</a> for offline reading. If you found something wrong, please do <a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3293801-21', 'auto');
ga('send', 'pageview');
</script>
</body></html>