On 05/18/2012 01:37 PM, Perry Peeters wrote:
> I'm in the process of adding 2000+ new users (all external recipients) and 
> wondered if 
> it is possible to run a script to do so.
> What I'm looking for is a script to add users using a csv format file with 
> email-address and (static) password.

I have added a command line interface (CLI) tool which allows you to
set/get properties and import users and/or domains from an XML file. A
release candidate of the upcoming release will probably be available at
the beginning of next week. If you cannot wait, you can download an
updated djigzo jar file from the website which contains the CLI tool.

Download the the file djigzo_2.4.0-2.jar and place the file in the home
directory of djigzo (with a default install this should be
/usr/share/djigzo).

http://www.djigzo.com/downloads/djigzo_2.4.0-2.jar

note: *don't* rename the file to djigzo.jar because you want to keep the
original djigzo.jar file.

the CLI tool can be started with the following command (from the
directory /usr/share/djigzo):

java -cp djigzo_2.4.0-2.jar mitm.application.djigzo.tools.CLITool

This will show the available commands:

usage: mitm.application.djigzo.tools.CLITool [--add-domain <DOMAIN>]
       [--add-user <EMAIL>] [--delete-domain <DOMAIN>] [--delete-user
<EMAIL>]
       [--domain <DOMAIN>] [--email <EMAIL>] [--encode-password <PASSWORD>]
       [--encrypt] [--get-property <PROPERTY NAME>] [--global] [--help]
[--host
       <HOSTNAME | IP>] [--import-xml <XML FILE>] [--logging] [--port
<PORT>]
       [--salt <SALT>] [--set-property <PROPERTY NAME>] [--soap-password
<SOAP
       PASSWORD>] [--soap-user <SOAP USER>] [--value <VALUE>]
    --add-domain <DOMAIN>             Add a domain
    --add-user <EMAIL>                Add a user
    --delete-domain <DOMAIN>          Delete a domain
    --delete-user <EMAIL>             Delete a user
    --domain <DOMAIN>                 The domain
    --email <EMAIL>                   The email address of the user
    --encode-password <PASSWORD>      Encodes a portal password
    --encrypt                         If set, the property is an encrypted
                                      property
    --get-property <PROPERTY NAME>    Returns a property value
    --global                          Set/Get the global options
    --help                            Show help
    --host <HOSTNAME | IP>            The host to connect to (127.0.0.1)
    --import-xml <XML FILE>           Import users and domains from XML
    --logging                         If set, debug logging will be
                                      enabled
    --port <PORT>                     The port to use (9000)
    --salt <SALT>                     Optional salt used for encoding a
                                      portal password
    --set-property <PROPERTY NAME>    Sets a property
    --soap-password <SOAP PASSWORD>   the user password for SOAP interface
    --soap-user <SOAP USER>           the user for SOAP interface
    --value <VALUE>                   The value to set

To set a property you can use --set-property. Some properties are
encrypted. For example the password, portal password, client secret and
server secret are encrypted. You therefore need to add the --encrypt
property when you set/get any of these encrypted properties

for example to set the password property (for PDF encryption) of user
[email protected] use the following command:

java -cp djigzo_2.4.0-2.jar mitm.application.djigzo.tools.CLITool
--set-property user.password --email [email protected] --value test --encrypt

You can import users and domains (and any property) in bulk from an XML
file using the --import-xml command.

An example XML import file can be downloaded from

http://www.djigzo.com/downloads/djigzo-import.xml


WARNING: you can screw up the gateway (not beyond repair though) when
using the CLI tool.

the CLI tool does not validate any user input. You can set property
values to any value even if that value doesn't make sense. For example
the only legal values for the locality property are "internal" or
"external". You can however set it to any value, even to values which
are not valid. If you set an encrypted property value but forget to
provide the --encrypt parameter, the next time the property is read by
the system, decrypting the value will fail (which will result in
undefined behaviour).

Kind regards,

Martijn Brinkers

-- 
DJIGZO email encryption
_______________________________________________
Users mailing list
[email protected]
http://lists.djigzo.com/lists/listinfo/users

Reply via email to