# Is there an easy way of creating multiple domains with the same settings?

**URL:** <https://community.ciphermail.com/t/is-there-an-easy-way-of-creating-multiple-domains-with-the-same-settings/843>\
**Category:** Gateway\
**Created:** [May 2, 2023, 3:29pm UTC](https://community.ciphermail.com/t/is-there-an-easy-way-of-creating-multiple-domains-with-the-same-settings/843 "2023-05-02T15:29:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarah](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Sarah](https://community.ciphermail.com/u/Sarah)\
**Post date:** [May 2, 2023, 3:29pm UTC](https://community.ciphermail.com/t/is-there-an-easy-way-of-creating-multiple-domains-with-the-same-settings/843/1 "2023-05-02T15:29:19Z")

</div>

I have a question regarding the domain settings of the Encryption Gateway.  
Since we might want to use PGP with external domains in the future I have set up the locality of the global preferences to “external”.  
I have then created a domain with the locality set to “internal” and it works fine.  
Now that we want to use Ciphermail globally I have to set up 79 domains with the same settings.  
Unfortunately I haven’t found any possibility to copy domain settings.  
Is there any easy way of configuring this for example copying the config in the config files?  
For the relay domains I have just added all domains in the MTA config file which worked great.

Many thanks in advance!

Sarah

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [May 3, 2023, 8:16am UTC](https://community.ciphermail.com/t/is-there-an-easy-way-of-creating-multiple-domains-with-the-same-settings/843/2 "2023-05-03T08:16:46Z")

</div>

At the moment options to automate the configuration without creating some code are limited. If you want full control you need to create a service which communicates with the SOAP back-end.

There is a basic CLI tool which can be used add domains/users and can set properties.

To start the CLI tool you need to login to the gateway and execute the following command

```auto
java -cp '/usr/share/djigzo/lib/*' mitm.application.djigzo.tools.CLITool

```

**WARNING** : the CLI tool will not validate any property names/values. You can mess up the gateway if you set an incorrect value.

Examples:

To add a domain:

```auto
java -cp '/usr/share/djigzo/lib/*' mitm.application.djigzo.tools.CLITool \
--add-domain example.com

```

To set a domain property:

```auto
java -cp '/usr/share/djigzo/lib/*' mitm.application.djigzo.tools.CLITool \
--domain example.com --set-property user.locality --value Internal

```

To get a domain property:

```auto
java -cp '/usr/share/djigzo/lib/*' mitm.application.djigzo.tools.CLITool \
--domain example.com --get-property user.locality

```

You can also import an XML file with a number of domains/users:

```auto
java -cp '/usr/share/djigzo/lib/*' mitm.application.djigzo.tools.CLITool --import-xml testData.xml

```

(see attached xml file)

[testData.xml](https://community.ciphermail.com/uploads/short-url/yNNIHg3zogzaXYFGHcYZo5c9W10.xml) (2.8 KB)

**The CLI tools comes with no warranty. You can mess up your system.**

The next major release will contain a newly written CLI with advanced functionality and which will validate the input.

---

<div class="post-metadata">

**Author:** ![Sarah](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Sarah](https://community.ciphermail.com/u/Sarah)\
**Post date:** [May 22, 2023, 1:49pm UTC](https://community.ciphermail.com/t/is-there-an-easy-way-of-creating-multiple-domains-with-the-same-settings/843/3 "2023-05-22T13:49:20Z")

</div>

I’ve just had time to test your advice.  
I did the config with the xml file and it worked well.  
Saved me a lot of work.  
Thanks for your help!
