From fc121f115117b8bff4a5d118ff379eafc7cfeaec Mon Sep 17 00:00:00 2001 From: Zhang Huangbin Date: Tue, 15 Dec 2015 20:19:22 +0800 Subject: [PATCH] New: html/sql.mark.user.as.admin.html. --- en_US/howto/sql.mark.user.as.admin.md | 40 +++++++++++++++ html/index.html | 1 + html/sql.mark.user.as.admin.html | 71 +++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 en_US/howto/sql.mark.user.as.admin.md create mode 100644 html/sql.mark.user.as.admin.html diff --git a/en_US/howto/sql.mark.user.as.admin.md b/en_US/howto/sql.mark.user.as.admin.md new file mode 100644 index 00000000..8e6b5a12 --- /dev/null +++ b/en_US/howto/sql.mark.user.as.admin.md @@ -0,0 +1,40 @@ +# SQL: Mark existing mail user as global domain admin + +[TOC] + +### Mark user as global domain admin with iRedAdmin-Pro + +With iRedAdmin-Pro, you can mark user as either global domain admin or normal +domain admin in user profile page, under tab `General`. + +![](../images/iredadmin/user_profile_general.png) + +### Mark user as global domain admin with SQL command line tool + +> If you don't have any mail account, please follow this tutorial to create a +> new mail user: [SQL: Bulk create mail users](./sql.bulk.create.mail.users.html). + +Let's say you want to mark existing user `user@mydomain.com` as global domain +admin, please follow steps below to achieve this. + +* Login to SQL server as either SQL root user or `vmailadmin` user. + + * About SQL root user: + + * for MySQL or MariaDB: SQL root user is `root`. + * for PostgreSQL: it's system account `postgres` on Linux, or + `postgresql` on FreeBSD, or `_pgsql` on OpenBSD. + + * You can find their passwords in file `iRedMail.tips` under iRedMail + installation directory. for example, `/root/iRedMail-0.9.3/iRedMail.tips`. + +* Update SQL table `vmail.mailbox` and `vmail.domain_admins` to mark this user + as global domain admin: + +``` +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'); +``` + +Now you can login to iRedAdmin-Pro as `user@mydomain.com`, it's global domain +admin. diff --git a/html/index.html b/html/index.html index a74815b1..b2f611f7 100644 --- a/html/index.html +++ b/html/index.html @@ -112,6 +112,7 @@
  • SQL: Bulk create mail users
  • SQL: Add per-domain catch-all account
  • SQL: Add a mail alias account
  • +
  • SQL: Mark existing mail user as global domain admin
  • SQL: User mail forwarding
  • Store SpamAssassin bayes in SQL
  • Use a bought SSL certificate
  • diff --git a/html/sql.mark.user.as.admin.html b/html/sql.mark.user.as.admin.html new file mode 100644 index 00000000..d99fdd0b --- /dev/null +++ b/html/sql.mark.user.as.admin.html @@ -0,0 +1,71 @@ + + + + SQL: Mark existing mail user as global domain admin + + + + +

    SQL: Mark existing mail user as global domain admin

    +
    + +
    +

    Mark user as global domain admin with iRedAdmin-Pro

    +

    With iRedAdmin-Pro, you can mark user as either global domain admin or normal +domain admin in user profile page, under tab General.

    +

    +

    Mark user as global domain admin with SQL command line tool

    +
    +

    If you don't have any mail account, please follow this tutorial to create a +new mail user: SQL: Bulk create mail users.

    +
    +

    Let's say you want to mark existing user user@mydomain.com as global domain +admin, please follow steps below to achieve this.

    + +
    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');
    +
    + +

    Now you can login to iRedAdmin-Pro as user@mydomain.com, it's global domain +admin.

    All documents are available in BitBucket repository, and published under Creative Commons license. If you found something wrong, please do contact us to fix it. + \ No newline at end of file