makeplane / makeplane/plane

[bug]: test email not sending while setting up SMTP

Open
#9,472 1 comment 0 reactions 2 assignees View on GitHub

@vihar is already working on this.

Since Jul 24, 2026.

🐛bug plane
Dominant language
TypeScript
Stars
59.6k
Forks
5.8k
Avg merge
1d 22h
Merged PRs (30d)
49

Description

Is there an existing issue for this?
  • I have searched the existing issues
Current behavior

When setting up SMTP for the first time under Instance Admin (God Mode) → Settings → Email, if you fill in the SMTP fields and click "Send test email" without clicking "Save Changes" first, the request fails with a 500 error instead of a validation message.

Backend log shows:
ValueError: invalid literal for int() with base 10: ''
at plane/license/api/views/configuration.py, line 110, in post
port=int(EMAIL_PORT)

The test-email endpoint (/api/instances/email-credentials-check/) appears to be reading EMAIL_PORT (and presumably the other SMTP fields) from the last saved instance configuration rather than the values currently typed into the form. Since nothing had been saved yet, EMAIL_PORT was an empty string, and int('') threw an unhandled ValueError, causing a 500.

What I expected: either the test should validate against the unsaved form values (so first-time setup works without a separate save step), or if it's intentional that test-email only works against saved config, the UI should block the test / show a clear "please save your settings first" message instead of silently failing with a 500.

Steps to reproduce
  1. Go to Instance Admin (God Mode) → Settings → Email on a fresh instance with no email config saved yet.
  2. Fill in SMTP Host, Username, Password, Port, and Sender Email.
  3. Without clicking "Save Changes", click "Send test email".
  4. Request to POST /api/instances/email-credentials-check/ returns 500.
  5. Backend logs show ValueError: invalid literal for int() with base 10: '' at configuration.py line 110.
  6. Click "Save Changes", then click "Send test email" again — this time it succeeds.
Environment

Production

Browser

Google Chrome

Variant

Self-hosted

Version

v1.3.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.