Update en_US/howto/sql.create.mail.alias.md with new sql structure.
This commit is contained in:
parent
424b1097d2
commit
e4831865aa
|
@ -0,0 +1,68 @@
|
|||
# SQL: Add a mail alias account
|
||||
|
||||
[TOC]
|
||||
|
||||
!!! note
|
||||
|
||||
This document is applicable to iRedMail-0.9.6 and earlier releases.
|
||||
|
||||
## Create mail alias account with iRedAdmin-Pro
|
||||
|
||||
With iRedAdmin-Pro, you can easily add mail list account by click menu:
|
||||
`Add -> Mail List` (or `Add -> Alias` for SQL backends) in main
|
||||
navigation bar.
|
||||
|
||||
![](../images/iredadmin/maillist_create.png)
|
||||
|
||||
## Create mail alias account with SQL command line
|
||||
|
||||
To create an mail alias account, you can simply insert a SQL record in table
|
||||
`vmail.alias`. For example:
|
||||
|
||||
```mysql
|
||||
sql> USE vmail;
|
||||
sql> INSERT INTO alias (address, goto, domain, islist) \
|
||||
VALUES ('original@example.com', \
|
||||
'user1@example.com,user2@example.com,user1@test.com', \
|
||||
'example.com', \
|
||||
1);
|
||||
```
|
||||
|
||||
__NOTES__:
|
||||
|
||||
* Please always use lower cases for email addresses.
|
||||
* Multiple destination addresses must be separated by comma.
|
||||
* If destination address is a mail user under domain hosted on localhost,
|
||||
it must exist. Otherwise emails sent to alias account will be bounced after
|
||||
expanded to destination addresses.
|
||||
|
||||
## Access policy
|
||||
|
||||
You can restrict which senders are allowed to send email to this mail alias
|
||||
account by adding proper policy name in SQL column `alias.accesspolicy`.
|
||||
For example:
|
||||
|
||||
```
|
||||
sql> UPDATE alias SET accesspolicy='domain' WHERE address='original@example.com';
|
||||
```
|
||||
|
||||
Available access policies are:
|
||||
|
||||
* `public`: no restrictions.
|
||||
* `domain`: all users under same domain are allowed to send email to this mail list.
|
||||
* `subdomain`: all users under same domain and sub-domains are allowed to send email to this mail list.
|
||||
* `membersOnly`: only members of this mail list are allowd.
|
||||
* `allowedOnly`: only moderators of this mail list are allowed. Moderators
|
||||
are email addresses stored in SQL column `alias.moderators`. With iRedAPD-1.4.5,
|
||||
it's ok to use `*@domain.com` as (one of) moderator for all users under
|
||||
mail domain 'domain.com'.
|
||||
* `membersAndModeratorsOnly`: only members and moderators of this mail list are allowed.
|
||||
|
||||
Access restriction is implemented in iRedAPD (a simple Postfix policy server),
|
||||
iRedMail has it enabled by default. You'd better check its config file
|
||||
`/opt/iredapd/settings.py` to make sure plugin `sql_alias_access_policy` is
|
||||
enabled in parameter `plugins = []`.
|
||||
|
||||
## See also
|
||||
|
||||
* [Create mailing list for OpenLDAP backend](./ldap.add.mail.list.html)
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
[TOC]
|
||||
|
||||
!!! note
|
||||
|
||||
* This document is applicable to iRedMail-0.9.7 and later releases.
|
||||
* Here's [doc for iRedMail-0.9.6 and earlier releases](./sql.create.mail.alias-20170701.html).
|
||||
|
||||
## Create mail alias account with iRedAdmin-Pro
|
||||
|
||||
With iRedAdmin-Pro, you can easily add mail list account by click menu:
|
||||
|
@ -12,52 +17,84 @@ navigation bar.
|
|||
|
||||
## Create mail alias account with SQL command line
|
||||
|
||||
To create an mail alias account, you can simply insert a SQL record in table
|
||||
`vmail.alias`. For example:
|
||||
To create an mail alias account, you need to add SQL records in 2 sql tables.
|
||||
for example: create a mail alias account `alias@mydomain.com` and forward emails
|
||||
to two addresses `someone@gmail.com` and `someone@test.com`:
|
||||
|
||||
```mysql
|
||||
sql> USE vmail;
|
||||
sql> INSERT INTO alias (address, goto, domain, islist) \
|
||||
VALUES ('original@example.com', \
|
||||
'user1@example.com,user2@example.com,user1@test.com', \
|
||||
'example.com', \
|
||||
1);
|
||||
|
||||
-- Create mail alias account
|
||||
sql> INSERT INTO alias (address, domain, active)
|
||||
VALUES ('alias@mydomain.com', 'mydomain.com', 1);
|
||||
|
||||
-- Forward email to 'someone@gmail.com'
|
||||
sql> INSERT INTO forwardings (address, forwarding,
|
||||
domain, dest_domain,
|
||||
is_list, active)
|
||||
VALUES ('alias@mydomain.com', 'someone@gmail.com',
|
||||
'mydomain.com', 'gmail.com',
|
||||
1, 1);
|
||||
|
||||
-- Forward email to 'someone@test.com'
|
||||
sql> INSERT INTO forwardings (address, forwarding,
|
||||
domain, dest_domain,
|
||||
is_list, active)
|
||||
VALUES ('alias@mydomain.com', 'someone@test.com',
|
||||
'mydomain.com', 'test.com',
|
||||
1, 1);
|
||||
```
|
||||
|
||||
__NOTES__:
|
||||
|
||||
* Please always use lower cases for email addresses.
|
||||
* Multiple destination addresses must be separated by comma.
|
||||
* If destination address is a mail user under domain hosted on localhost,
|
||||
it must exist. Otherwise emails sent to alias account will be bounced after
|
||||
expanded to destination addresses.
|
||||
|
||||
## Access policy
|
||||
|
||||
!!! attention
|
||||
|
||||
Access restriction requires iRedAPD plugin `sql_alias_access_policy`,
|
||||
please make sure it's enabled in iRedAPD config file
|
||||
`/opt/iredapd/settings.py`.
|
||||
|
||||
You can restrict which senders are allowed to send email to this mail alias
|
||||
account by adding proper policy name in SQL column `alias.accesspolicy`.
|
||||
For example:
|
||||
|
||||
```
|
||||
sql> UPDATE alias SET accesspolicy='domain' WHERE address='original@example.com';
|
||||
sql> UPDATE alias SET accesspolicy='domain' WHERE address='alias@mydomain.com';
|
||||
```
|
||||
|
||||
Available access policies are:
|
||||
Available access policies:
|
||||
|
||||
* `public`: no restrictions.
|
||||
* `domain`: all users under same domain are allowed to send email to this mail list.
|
||||
* `subdomain`: all users under same domain and sub-domains are allowed to send email to this mail list.
|
||||
* `membersOnly`: only members of this mail list are allowd.
|
||||
* `allowedOnly`: only moderators of this mail list are allowed. Moderators
|
||||
are email addresses stored in SQL column `alias.moderators`. With iRedAPD-1.4.5,
|
||||
it's ok to use `*@domain.com` as (one of) moderator for all users under
|
||||
mail domain 'domain.com'.
|
||||
* `membersAndModeratorsOnly`: only members and moderators of this mail list are allowed.
|
||||
Access Policy Name | Comment
|
||||
--- |---
|
||||
`public` | no restrictions
|
||||
`domain` | all users under same domain are allowed to send email to this mail list.
|
||||
`subdomain` | all users under same domain and all sub-domains are allowed to send email to this mail list.
|
||||
`membersonly` | only members of this mail list are allowd.
|
||||
`moderatorsonly` | only moderators of this mail list are allowed.
|
||||
`membersandmoderatorsonly` | only members and moderators of this mail list are allowed.
|
||||
|
||||
Access restriction is implemented in iRedAPD (a simple Postfix policy server),
|
||||
iRedMail has it enabled by default. You'd better check its config file
|
||||
`/opt/iredapd/settings.py` to make sure plugin `sql_alias_access_policy` is
|
||||
enabled in parameter `plugins = []`.
|
||||
### How to assign a moderator
|
||||
|
||||
Moderators are email addresses stored in SQL table `alias_moderators`. With
|
||||
iRedAPD-1.4.5 and later releases, it's ok to use `*@domain.com` as (one of)
|
||||
moderator for all users under mail domain 'domain.com'.
|
||||
|
||||
To assign user `someone@gmail.com` and `someone@outlook.com` as moderator of
|
||||
mail alias `alias@mydomain.com`:
|
||||
|
||||
```
|
||||
sql> INSERT INTO alias_moderators (address, moderator, domain, dest_domain)
|
||||
VALUES ('alias@mydomain.com', 'someone@gmail.com', 'mydomain.com', 'gmail.com');
|
||||
|
||||
sql> INSERT INTO alias_moderators (address, moderator, domain, dest_domain)
|
||||
VALUES ('alias@mydomain.com', 'someone@outlook.com', 'mydomain.com', 'outlook.com');
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>SQL: Add a mail alias account</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;"
|
||||
/>
|
||||
<span>iRedMail</span>
|
||||
</a>
|
||||
// <a href="./index.html">Document Index</a></div><h1 id="sql-add-a-mail-alias-account">SQL: Add a mail alias account</h1>
|
||||
<div class="toc">
|
||||
<ul>
|
||||
<li><a href="#sql-add-a-mail-alias-account">SQL: Add a mail alias account</a><ul>
|
||||
<li><a href="#create-mail-alias-account-with-iredadmin-pro">Create mail alias account with iRedAdmin-Pro</a></li>
|
||||
<li><a href="#create-mail-alias-account-with-sql-command-line">Create mail alias account with SQL command line</a></li>
|
||||
<li><a href="#access-policy">Access policy</a></li>
|
||||
<li><a href="#see-also">See also</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<p>This document is applicable to iRedMail-0.9.6 and earlier releases.</p>
|
||||
</div>
|
||||
<h2 id="create-mail-alias-account-with-iredadmin-pro">Create mail alias account with iRedAdmin-Pro</h2>
|
||||
<p>With iRedAdmin-Pro, you can easily add mail list account by click menu:
|
||||
<code>Add -> Mail List</code> (or <code>Add -> Alias</code> for SQL backends) in main
|
||||
navigation bar.</p>
|
||||
<p><img alt="" src="../images/iredadmin/maillist_create.png" /></p>
|
||||
<h2 id="create-mail-alias-account-with-sql-command-line">Create mail alias account with SQL command line</h2>
|
||||
<p>To create an mail alias account, you can simply insert a SQL record in table
|
||||
<code>vmail.alias</code>. For example:</p>
|
||||
<pre><code class="mysql">sql> USE vmail;
|
||||
sql> INSERT INTO alias (address, goto, domain, islist) \
|
||||
VALUES ('original@example.com', \
|
||||
'user1@example.com,user2@example.com,user1@test.com', \
|
||||
'example.com', \
|
||||
1);
|
||||
</code></pre>
|
||||
|
||||
<p><strong>NOTES</strong>:</p>
|
||||
<ul>
|
||||
<li>Please always use lower cases for email addresses.</li>
|
||||
<li>Multiple destination addresses must be separated by comma.</li>
|
||||
<li>If destination address is a mail user under domain hosted on localhost,
|
||||
it must exist. Otherwise emails sent to alias account will be bounced after
|
||||
expanded to destination addresses.</li>
|
||||
</ul>
|
||||
<h2 id="access-policy">Access policy</h2>
|
||||
<p>You can restrict which senders are allowed to send email to this mail alias
|
||||
account by adding proper policy name in SQL column <code>alias.accesspolicy</code>.
|
||||
For example:</p>
|
||||
<pre><code>sql> UPDATE alias SET accesspolicy='domain' WHERE address='original@example.com';
|
||||
</code></pre>
|
||||
|
||||
<p>Available access policies are:</p>
|
||||
<ul>
|
||||
<li><code>public</code>: no restrictions.</li>
|
||||
<li><code>domain</code>: all users under same domain are allowed to send email to this mail list.</li>
|
||||
<li><code>subdomain</code>: all users under same domain and sub-domains are allowed to send email to this mail list.</li>
|
||||
<li><code>membersOnly</code>: only members of this mail list are allowd.</li>
|
||||
<li><code>allowedOnly</code>: only moderators of this mail list are allowed. Moderators
|
||||
are email addresses stored in SQL column <code>alias.moderators</code>. With iRedAPD-1.4.5,
|
||||
it's ok to use <code>*@domain.com</code> as (one of) moderator for all users under
|
||||
mail domain 'domain.com'.</li>
|
||||
<li><code>membersAndModeratorsOnly</code>: only members and moderators of this mail list are allowed.</li>
|
||||
</ul>
|
||||
<p>Access restriction is implemented in iRedAPD (a simple Postfix policy server),
|
||||
iRedMail has it enabled by default. You'd better check its config file
|
||||
<code>/opt/iredapd/settings.py</code> to make sure plugin <code>sql_alias_access_policy</code> is
|
||||
enabled in parameter <code>plugins = []</code>.</p>
|
||||
<h2 id="see-also">See also</h2>
|
||||
<ul>
|
||||
<li><a href="./ldap.add.mail.list.html">Create mailing list for OpenLDAP backend</a></li>
|
||||
</ul><div class="footer">
|
||||
<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.</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
(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>
|
|
@ -21,59 +21,122 @@
|
|||
<li><a href="#sql-add-a-mail-alias-account">SQL: Add a mail alias account</a><ul>
|
||||
<li><a href="#create-mail-alias-account-with-iredadmin-pro">Create mail alias account with iRedAdmin-Pro</a></li>
|
||||
<li><a href="#create-mail-alias-account-with-sql-command-line">Create mail alias account with SQL command line</a></li>
|
||||
<li><a href="#access-policy">Access policy</a></li>
|
||||
<li><a href="#access-policy">Access policy</a><ul>
|
||||
<li><a href="#how-to-assign-a-moderator">How to assign a moderator</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#see-also">See also</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<ul>
|
||||
<li>This document is applicable to iRedMail-0.9.7 and later releases.</li>
|
||||
<li>Here's <a href="./sql.create.mail.alias-20170701.html">doc for iRedMail-0.9.6 and earlier releases</a>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2 id="create-mail-alias-account-with-iredadmin-pro">Create mail alias account with iRedAdmin-Pro</h2>
|
||||
<p>With iRedAdmin-Pro, you can easily add mail list account by click menu:
|
||||
<code>Add -> Mail List</code> (or <code>Add -> Alias</code> for SQL backends) in main
|
||||
navigation bar.</p>
|
||||
<p><img alt="" src="../images/iredadmin/maillist_create.png" /></p>
|
||||
<h2 id="create-mail-alias-account-with-sql-command-line">Create mail alias account with SQL command line</h2>
|
||||
<p>To create an mail alias account, you can simply insert a SQL record in table
|
||||
<code>vmail.alias</code>. For example:</p>
|
||||
<p>To create an mail alias account, you need to add SQL records in 2 sql tables.
|
||||
for example: create a mail alias account <code>alias@mydomain.com</code> and forward emails
|
||||
to two addresses <code>someone@gmail.com</code> and <code>someone@test.com</code>:</p>
|
||||
<pre><code class="mysql">sql> USE vmail;
|
||||
sql> INSERT INTO alias (address, goto, domain, islist) \
|
||||
VALUES ('original@example.com', \
|
||||
'user1@example.com,user2@example.com,user1@test.com', \
|
||||
'example.com', \
|
||||
1);
|
||||
|
||||
-- Create mail alias account
|
||||
sql> INSERT INTO alias (address, domain, active)
|
||||
VALUES ('alias@mydomain.com', 'mydomain.com', 1);
|
||||
|
||||
-- Forward email to 'someone@gmail.com'
|
||||
sql> INSERT INTO forwardings (address, forwarding,
|
||||
domain, dest_domain,
|
||||
is_list, active)
|
||||
VALUES ('alias@mydomain.com', 'someone@gmail.com',
|
||||
'mydomain.com', 'gmail.com',
|
||||
1, 1);
|
||||
|
||||
-- Forward email to 'someone@test.com'
|
||||
sql> INSERT INTO forwardings (address, forwarding,
|
||||
domain, dest_domain,
|
||||
is_list, active)
|
||||
VALUES ('alias@mydomain.com', 'someone@test.com',
|
||||
'mydomain.com', 'test.com',
|
||||
1, 1);
|
||||
</code></pre>
|
||||
|
||||
<p><strong>NOTES</strong>:</p>
|
||||
<ul>
|
||||
<li>Please always use lower cases for email addresses.</li>
|
||||
<li>Multiple destination addresses must be separated by comma.</li>
|
||||
<li>If destination address is a mail user under domain hosted on localhost,
|
||||
it must exist. Otherwise emails sent to alias account will be bounced after
|
||||
expanded to destination addresses.</li>
|
||||
</ul>
|
||||
<h2 id="access-policy">Access policy</h2>
|
||||
<div class="admonition attention">
|
||||
<p class="admonition-title">Attention</p>
|
||||
<p>Access restriction requires iRedAPD plugin <code>sql_alias_access_policy</code>,
|
||||
please make sure it's enabled in iRedAPD config file
|
||||
<code>/opt/iredapd/settings.py</code>.</p>
|
||||
</div>
|
||||
<p>You can restrict which senders are allowed to send email to this mail alias
|
||||
account by adding proper policy name in SQL column <code>alias.accesspolicy</code>.
|
||||
For example:</p>
|
||||
<pre><code>sql> UPDATE alias SET accesspolicy='domain' WHERE address='original@example.com';
|
||||
<pre><code>sql> UPDATE alias SET accesspolicy='domain' WHERE address='alias@mydomain.com';
|
||||
</code></pre>
|
||||
|
||||
<p>Available access policies:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Access Policy Name</th>
|
||||
<th>Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>public</code></td>
|
||||
<td>no restrictions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>domain</code></td>
|
||||
<td>all users under same domain are allowed to send email to this mail list.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>subdomain</code></td>
|
||||
<td>all users under same domain and all sub-domains are allowed to send email to this mail list.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>membersonly</code></td>
|
||||
<td>only members of this mail list are allowd.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>moderatorsonly</code></td>
|
||||
<td>only moderators of this mail list are allowed.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>membersandmoderatorsonly</code></td>
|
||||
<td>only members and moderators of this mail list are allowed.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="how-to-assign-a-moderator">How to assign a moderator</h3>
|
||||
<p>Moderators are email addresses stored in SQL table <code>alias_moderators</code>. With
|
||||
iRedAPD-1.4.5 and later releases, it's ok to use <code>*@domain.com</code> as (one of)
|
||||
moderator for all users under mail domain 'domain.com'.</p>
|
||||
<p>To assign user <code>someone@gmail.com</code> and <code>someone@outlook.com</code> as moderator of
|
||||
mail alias <code>alias@mydomain.com</code>:</p>
|
||||
<pre><code>sql> INSERT INTO alias_moderators (address, moderator, domain, dest_domain)
|
||||
VALUES ('alias@mydomain.com', 'someone@gmail.com', 'mydomain.com', 'gmail.com');
|
||||
|
||||
sql> INSERT INTO alias_moderators (address, moderator, domain, dest_domain)
|
||||
VALUES ('alias@mydomain.com', 'someone@outlook.com', 'mydomain.com', 'outlook.com');
|
||||
</code></pre>
|
||||
|
||||
<p>Available access policies are:</p>
|
||||
<ul>
|
||||
<li><code>public</code>: no restrictions.</li>
|
||||
<li><code>domain</code>: all users under same domain are allowed to send email to this mail list.</li>
|
||||
<li><code>subdomain</code>: all users under same domain and sub-domains are allowed to send email to this mail list.</li>
|
||||
<li><code>membersOnly</code>: only members of this mail list are allowd.</li>
|
||||
<li><code>allowedOnly</code>: only moderators of this mail list are allowed. Moderators
|
||||
are email addresses stored in SQL column <code>alias.moderators</code>. With iRedAPD-1.4.5,
|
||||
it's ok to use <code>*@domain.com</code> as (one of) moderator for all users under
|
||||
mail domain 'domain.com'.</li>
|
||||
<li><code>membersAndModeratorsOnly</code>: only members and moderators of this mail list are allowed.</li>
|
||||
</ul>
|
||||
<p>Access restriction is implemented in iRedAPD (a simple Postfix policy server),
|
||||
iRedMail has it enabled by default. You'd better check its config file
|
||||
<code>/opt/iredapd/settings.py</code> to make sure plugin <code>sql_alias_access_policy</code> is
|
||||
enabled in parameter <code>plugins = []</code>.</p>
|
||||
<h2 id="see-also">See also</h2>
|
||||
<ul>
|
||||
<li><a href="./ldap.add.mail.list.html">Create mailing list for OpenLDAP backend</a></li>
|
||||
|
|
Loading…
Reference in New Issue