2017-07-02 21:02:07 -05:00
<!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 >
2019-07-13 06:21:55 -05:00
2017-07-02 21:02:07 -05:00
< div id = "navigation" >
2017-11-16 21:48:44 -06:00
< a href = "https://www.iredmail.org" target = "_blank" >
2017-07-02 21:02:07 -05:00
< 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 >
2018-07-04 03:57:29 -05:00
< div class = "admonition warning" >
< p class = "admonition-title" > Warning< / p >
2017-07-08 22:25:23 -05:00
< ul >
< li > This document is applicable to iRedMail-0.9.6 and earlier releases.< / li >
< li > Here's < a href = "./sql.create.mail.alias.html" > doc for iRedMail-0.9.7 and later releases< / a > .< / li >
< / ul >
2017-07-02 21:02:07 -05:00
< / 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 >
2017-10-28 00:38:13 -05:00
< p > < img alt = "" src = "./images/iredadmin/maillist_create.png" / > < / p >
2017-07-02 21:02:07 -05:00
< 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 >
2018-06-20 04:02:51 -05:00
< 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
2017-07-02 21:02:07 -05:00
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 >
2018-06-20 04:02:51 -05:00
< li > < code > membersandmoderatorsonly< / code > : only members and moderators of this mail list are allowed.< / li >
2017-07-02 21:02:07 -05:00
< / 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" >
2019-09-06 00:54:43 -05:00
< p style = "text-align: center; color: grey;" > All documents are available in < a href = "https://github.com/iredmail/docs/" > 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://github.com/iredmail/docs/archive/master.zip" > download the latest version< / a > for offline reading. If you found something wrong, please do < a href = "https://www.iredmail.org/contact.html" > contact us< / a > to fix it.< / p >
2017-07-02 21:02:07 -05:00
< / div >
2017-11-05 02:33:58 -06:00
<!-- Global site tag (gtag.js) - Google Analytics -->
< script async src = "https://www.googletagmanager.com/gtag/js?id=UA-3293801-21" > < / script >
< script >
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
2017-07-02 21:02:07 -05:00
2017-11-05 02:33:58 -06:00
gtag('config', 'UA-3293801-21');
2017-07-02 21:02:07 -05:00
< / script >
< / body > < / html >