2016-05-19 06:51:20 -05:00
<!DOCTYPE html>
2014-09-30 10:13:21 -05:00
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
2015-02-01 05:22:03 -06:00
< title > SQL: Add a mail alias account< / title >
2015-07-31 23:14:52 -05:00
< link rel = "stylesheet" type = "text/css" href = "./css/markdown.css" / >
2014-09-30 10:13:21 -05:00
< / head >
< body >
< div id = "navigation" >
2016-04-19 12:48:51 -05:00
< 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 >
2016-02-29 02:15:19 -06:00
// < a href = "./index.html" > Document Index< / a > < / div > < h1 id = "sql-add-a-mail-alias-account" > SQL: Add a mail alias account< / h1 >
2015-02-01 05:22:03 -06:00
< 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 >
< 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:
2015-08-04 22:07:00 -05:00
< code > Add -> Mail List< / code > (or < code > Add -> Alias< / code > for SQL backends) in main
2015-08-01 23:20:30 -05:00
navigation bar.< / p >
2015-02-01 05:22:03 -06:00
< 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 >
2014-09-30 10:13:21 -05:00
< 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;
2015-02-24 01:47:50 -06:00
sql> INSERT INTO alias (address, goto, domain, islist) \
2014-09-30 10:13:21 -05:00
VALUES ('original@example.com', \
'user1@example.com,user2@example.com,user1@test.com', \
2015-02-20 08:02:03 -06:00
'example.com', \
1);
2014-09-30 10:13:21 -05:00
< / code > < / pre >
< p > < strong > NOTES< / strong > :< / p >
< ul >
< li > Please always use lower cases for email addresses.< / li >
2015-02-20 08:02:03 -06:00
< li > Multiple destination addresses must be separated by comma.< / li >
< li > If destination address is a mail user under domain hosted on localhost,
2014-09-30 10:13:21 -05:00
it must exist. Otherwise emails sent to alias account will be bounced after
expanded to destination addresses.< / li >
2015-02-01 05:22:03 -06:00
< / 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 >
2015-08-31 18:38:13 -05:00
< li > < code > allowedOnly< / code > : only moderators of this mail list are allowed. Moderators
2015-02-01 05:22:03 -06: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 >
< li > < code > memebersAndModeratorsOnly< / 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 >
2016-05-19 06:51:20 -05:00
< / 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" >
2015-02-05 07:02:53 -06:00
(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');
2014-10-13 19:28:43 -05:00
< / script >
< / body > < / html >