[Bug]: Admin email settings: "Send test email" tests unsaved values and fails until settings are saved first
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
On the admin Basic settings page (Administration settings → Basic settings → Email server),
the email/SMTP section has a "Send test e-mail" test button. When configuring SMTP for the first
time, clicking the test button before the settings are persisted makes the test run against the
old/empty configuration, so it fails — even though the entered values are correct. There is no hint
that the test uses saved values rather than the current form input. After the settings are saved, the same test succeeds.
This is confusing: it looks like the SMTP credentials are wrong when in fact only the
"save before test" ordering is the problem.
Steps to reproduce
- Go to Administration settings → Basic settings → Email server.
- Enter a fresh SMTP configuration (send mode, host, port, encryption, auth, username, app password).
- Immediately click Send test e-mail.
- The test fails / shows an error, despite correct values.
- Trigger a save, click Send test e-mail again → it now works.
Expected behavior
Either the test should be performed against the current form values, or the test button should be
disabled with a clear "save settings first" hint until the configuration has been persisted. At least the test button should be placed right of the save button.
Nextcloud Server version
33
Operating system
Debian/Ubuntu
PHP engine version
None
Web server
Apache (supported)
Database engine version
None
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
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 at Administration settings → Basic settings → Email server and trace the Send test e-mail action from the settings page. Reproduce the failure with unsaved SMTP values, then verify the chosen behavior: the test uses current form values or the button clearly requires saved settings. Confirm the test succeeds or the save requirement is unambiguous before marking it done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100