2018-01-12 22:57:01 -06:00
<!DOCTYPE html>
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< title > SQL: Add an alias domain< / title >
< link rel = "stylesheet" type = "text/css" href = "./css/markdown.css" / >
< / head >
< body >
2019-07-13 06:21:55 -05:00
2018-01-12 22:57:01 -06:00
< div id = "navigation" >
< a href = "https://www.iredmail.org" 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-an-alias-domain" > SQL: Add an alias domain< / h1 >
< div class = "toc" >
< ul >
< li > < a href = "#sql-add-an-alias-domain" > SQL: Add an alias domain< / a > < ul >
< li > < a href = "#what-an-alias-domain-is-used-for" > What an alias domain is used for?< / a > < / li >
< li > < a href = "#add-alias-domain-with-iredadmin-pro" > Add alias domain with iRedAdmin-Pro< / a > < / li >
< li > < a href = "#how-to-add-an-alias-domain-with-sql-commands" > How to add an alias domain with SQL commands< / a > < / li >
< / ul >
< / li >
< / ul >
< / div >
< h2 id = "what-an-alias-domain-is-used-for" > What an alias domain is used for?< / h2 >
< p > Let's say you have a mail domain < code > example.com< / code > hosted on your iRedMail server,
if you add domain name < code > domain.ltd< / code > as an alias domain of < code > example.com< / code > , all
emails sent to < code > username@domain.ltd< / code > will be delivered to user
< code > username@example.com< / code > 's mailbox.< / p >
< h2 id = "add-alias-domain-with-iredadmin-pro" > Add alias domain with iRedAdmin-Pro< / h2 >
< p > With iRedAdmin-Pro, you can simply add alias domain name in domain profile page,
under tab < code > Aliases< / code > .< / p >
< p > Screenshot:< / p >
< p > < img alt = "" src = "./images/iredadmin/domain_profile_alias.png" / > < / p >
< h2 id = "how-to-add-an-alias-domain-with-sql-commands" > How to add an alias domain with SQL commands< / h2 >
< p > Adding alias domain is as simple as inserting one SQL record. Let's create two
alias domains (< code > alias-1.com< / code > , < code > alias-2.com< / code > ) for the primary domain
< code > example.com< / code > with SQL commands below (Note: we use MySQL for example, but
PostgreSQL uses exactly same < code > INSERT< / code > commands):< / p >
< pre > < code > -- Connect to `vmail` database.
sql> USE vmail;
-- Create alias domain `alias-1.com`
sql> INSERT INTO alias_domain (alias_domain, target_domain) VALUES ('alias-1.com', 'example.com');
-- Create alias domain `alias-2.com`
sql> INSERT INTO alias_domain (alias_domain, target_domain) VALUES ('alias-2.com', 'example.com');
< / code > < / pre >
< p > That's all.< / p > < div class = "footer" >
2019-12-31 00:07:48 -06:00
< p style = "text-align: center; color: grey;" > All documents are available in < a href = "https://github.com/iredmail/docs/" > GitHub 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 >
2018-01-12 22:57:01 -06:00
< / div >
<!-- 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());
gtag('config', 'UA-3293801-21');
< / script >
< / body > < / html >