Allow setting admin user email via environment variable during initial setup
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
- [email protected]
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!