2016-05-19 06:51:20 -05:00
<!DOCTYPE html>
2015-12-15 06:19:22 -06:00
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< title > SQL: Mark existing mail user as global domain admin< / title >
< link rel = "stylesheet" type = "text/css" href = "./css/markdown.css" / >
< / 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-mark-existing-mail-user-as-global-domain-admin" > SQL: Mark existing mail user as global domain admin< / h1 >
2015-12-15 06:19:22 -06:00
< div class = "toc" >
< ul >
< li > < a href = "#sql-mark-existing-mail-user-as-global-domain-admin" > SQL: Mark existing mail user as global domain admin< / a > < ul >
< li > < a href = "#mark-user-as-global-domain-admin-with-iredadmin-pro" > Mark user as global domain admin with iRedAdmin-Pro< / a > < / li >
< li > < a href = "#mark-user-as-global-domain-admin-with-sql-command-line-tool" > Mark user as global domain admin with SQL command line tool< / a > < / li >
< / ul >
< / li >
< / ul >
< / div >
< h3 id = "mark-user-as-global-domain-admin-with-iredadmin-pro" > Mark user as global domain admin with iRedAdmin-Pro< / h3 >
< p > With iRedAdmin-Pro, you can mark user as either global domain admin or normal
domain admin in user profile page, under tab < code > General< / code > .< / p >
< p > < img alt = "" src = "../images/iredadmin/user_profile_general.png" / > < / p >
< h3 id = "mark-user-as-global-domain-admin-with-sql-command-line-tool" > Mark user as global domain admin with SQL command line tool< / h3 >
< blockquote >
< p > If you don't have any mail account, please follow this tutorial to create a
new mail user: < a href = "./sql.bulk.create.mail.users.html" > SQL: Bulk create mail users< / a > .< / p >
< / blockquote >
< p > Let's say you want to mark existing user < code > user@mydomain.com< / code > as global domain
admin, please follow steps below to achieve this.< / p >
< ul >
< li >
< p > Login to SQL server as either SQL root user or < code > vmailadmin< / code > user.< / p >
< ul >
< li >
< p > About SQL root user:< / p >
< ul >
< li > for MySQL or MariaDB: SQL root user is < code > root< / code > .< / li >
< li > for PostgreSQL: it's system account < code > postgres< / code > on Linux, or
< code > postgresql< / code > on FreeBSD, or < code > _pgsql< / code > on OpenBSD.< / li >
< / ul >
< / li >
< li >
< p > You can find their passwords in file < code > iRedMail.tips< / code > under iRedMail
installation directory. for example, < code > /root/iRedMail-0.9.3/iRedMail.tips< / code > .< / p >
< / li >
< / ul >
< / li >
< li >
< p > Update SQL table < code > vmail.mailbox< / code > and < code > vmail.domain_admins< / code > to mark this user
as global domain admin:< / p >
< / li >
< / ul >
< pre > < code > sql> UPDATE mailbox SET isadmin=1,isglobaladmin=1 WHERE username='user@mydomain.com';
sql> INSERT INTO domain_admins (username, domain) VALUES ('user@mydomain.com', 'ALL');
< / code > < / pre >
< p > Now you can login to iRedAdmin-Pro as < code > user@mydomain.com< / code > , it's global domain
2016-05-19 06:51:20 -05:00
admin.< / p > < 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-12-15 06:19:22 -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');
< / script >
< / body > < / html >