1

Topic: Adding A New Mail Domain from the Command Line

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9 MYSQL edition
- Deployed with iRedMail Easy or the downloadable installer? Downloadable installer.
- Linux/BSD distribution name and version: Ubuntu 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I know it's possible to create new mail users with the `create_mail_user_SQL.sh` script, but I'd also like to create new mail domains from the command line.

I've successfully created a new mail domain with:

USE vmail;
INSERT INTO domain (domain, transport, settings, created, active)
VALUES ('example.com', 'dovecot', 'default_user_quota:256;', NOW(), '1');

However, the documentation for the `create_mail_user_SQL.sh` script at https://docs.iredmail.org/sql.create.mail.user.html suggests to "create a new mail domain name with iRedAdmin first". So, I guess creating a new mail domain from the command line may be more complex than my simple SQL statement.

Is that correct or will the SQL statement above suffice?

Many thanks, Steve.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Adding A New Mail Domain from the Command Line

tech-otaku wrote:

Is that correct or will the SQL statement above suffice?

How about create one with iRedAdmin(-Pro) first and check the newly added SQL records? big_smile