gs_auth_token_create [-h] dsn


gs_auth_token_create creates a new token and adds it to the relational database. Once run it is necessary to change the authentication configuration.

Positional arguments


The data source name (DSN) in the form postgres://<user>:<password>@<host>:<port>/<database_name>. The configuration file for GroupServer (normally etc/gsconfig.ini) lists all the DSN entries for the system.

Optional arguments

-h, --help

Show a help message and exit


  • gs_auth_token_create returns 0 on success and the new token is displayed on the standard output.
  • 1 is returned if the system failed to make the initial connection to the database (the engine failed to be created).
  • 2 is returned if the system failed to connect for any other reason.

Authentication Configuration

The scripts that use the web-hooks, such as smtp2gs [1], use the configuration file for storing the token. gs_auth_token_create leaves these configuration files unaltered, because they can become complex. Instead it displays the new token and the administrator must change the entries in the configuration.


Generate a new token and place it in the production database. In this example PostgreSQL is running on the default port of the local machine — and has as been set up so authentication is unnecessary:

$ gs_auth_token_create posgres://localhost/production

Generate a new token and place it in the testing database on a remote machine — with the port 5432 explicitly passed. Authentication is used.

$ gs_auth_token_create \
[1]See <>