Allow setting admin user email via environment variable during initial setup
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 7.4k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
After a fresh Docker-based install with all SMTP settings supplied via environment variables, the send test via "Basic settings → Test and verify email settings" result in the following error:
AxiosError: Request failed with status code 400
This error message is not helpful and gives no indication of the root cause. It took me several days of debugging - including repeatedly verifying and adjusting the SMTP settings - before I realized that the problem was simply that the admin user had no email address set.
Expected Behavior
A fresh installation should allow specifying an admin email during setup. Without it, the email system silently fails with unclear error messages, despite all SMTP settings appearing correct.
Proposed Solution
Introduce a new environment variable, such as NEXTCLOUD_ADMIN_EMAIL, which can be used during container initialization to automatically assign an email address to the admin user.
environment:
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=secret
- NEXTCLOUD_ADMIN_EMAIL=admin@example.com
Benefits
- Prevents misleading errors like
AxiosError: Request failed with status code 400when testing email - Reduces time wasted on debugging SMTP configs
- Streamlined, fully automated deployment
- Enables functional email notifications from the start
- Avoids manual post-installation steps
This would align well with the goals of containerization and automation. Thanks for considering!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the container initialization path that handles NEXTCLOUD_ADMIN_USER and NEXTCLOUD_ADMIN_PASSWORD, then determine where a proposed admin email variable would be applied. Reproduce a fresh Docker-based install with SMTP settings and use “Basic settings → Test and verify email settings” to confirm that the email is set and the test no longer fails with the reported 400 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100