mjl- / mox

modern full-featured open source secure mail server for low-maintenance self-hosted email
https://www.xmox.nl
MIT License
3.71k stars 113 forks source link

Setting admin and accounts password headless #42

Closed pmarini closed 1 year ago

pmarini commented 1 year ago

I'm building a template for mox using the LXD-based framework of Nextcloud-related templates as available here: https://codeberg/pmarini/nc-env

As part of the provisioning I'm trying to pass the admin and an account password from the command line:

Example:

$ echo admin 321 | ./mox setaccountpassword admin@mox-mail-server.localenv.com

fails.

Is there a flag or another shell technique that allows to pipe the password in setaccountpassword and setadminpassword?

mjl- commented 1 year ago

Could it be you are running setaccountpassword before starting mox? It will try to talk to a running mox instance. "mox setadminpassword" just writes a file, so that can't be the problem there. Which error messages are you seeing? Setting a password like in your example seems to work for me.

pmarini commented 1 year ago

Hello,

setadminpassword is working as expected. My bad, it was indeed a file permission issue.

Didn't have time yet to test setaccountpassword, but this is a little bit less relevant.

On Sat, Jun 24, 2023, at 00:39, Mechiel Lukkien wrote:

Could it be you are running setaccountpassword before starting mox? It will try to talk to a running mox instance. "mox setadminpassword" just writes a file, so that can't be the problem there. Which error messages are you seeing? Setting a password like in your example seems to work for me.

— Reply to this email directly, view it on GitHub https://github.com/mjl-/mox/issues/42#issuecomment-1605070463, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYBU3FLDJJZBDFNQ7WHB33XMYLLTANCNFSM6AAAAAAZRX7WWQ. You are receiving this because you authored the thread.Message ID: @.***>

mjl- commented 1 year ago

Is this still an issue? If not, I would like to close it. (:

pmarini commented 1 year ago

Ok for me, thanks!