Reset password

Set admin password

If you have forgotten the admin password or want to set it from an automated setup flow, you can set the password via the command-line interface.

$ emailengine password -p secretvalue --dbs.redis="redis://127.0.0.1:6379/8"
secretvalue

Where

  • secretvalue is the password to use. If a password is not provided, then a random password is generated.

The command returns the updated admin password. This is primarily useful if you did not set the password yourself and skipped the -p or --password argument.

Exporting and importing

You can also use the password reset feature to export a password hash that you can use as a prepared password value. Add either --hash or -r flag to the password reset command to return not the password itself but the portable hash value.

$ emailengine password -p secretvalue --hash --dbs.redis="redis://127.0.0.1:6379/8"
JHBia2RmMi1zaGEyNTYkaT0yNTAwMCRuUlpVa1RxV2ptcHE5eWZrVWlaZmxnJFZ2KzVRN3VxcD...

You can then use this value either as EENGINE_PREPARED_PASSWORD environment variable value or --preparedPassword command line argument value.

It does not contain the actual password but its hash, so it is safe to include in configuration files or otherwhere. It assumes that the password you use is not easy enough to brute force.

$ emailengine --preparedPassword=JHBia2RmMi1zaGEyNTYkaT0yNTA...
...
{"level":20,"msg":"Imported hashed password","hash":"$pbkdf2-sha256$i=25000$nRZUkTqWjmp..."}