Skip to content

fix: add max validation for SMTP and IMAP ports#463

Open
ayesha-devx wants to merge 1 commit into
Kuldeeep18:mainfrom
ayesha-devx:fix-smtp-imap-validation
Open

fix: add max validation for SMTP and IMAP ports#463
ayesha-devx wants to merge 1 commit into
Kuldeeep18:mainfrom
ayesha-devx:fix-smtp-imap-validation

Conversation

@ayesha-devx

@ayesha-devx ayesha-devx commented Jun 27, 2026

Copy link
Copy Markdown

Pull Request

🔗 Related Issue

Closes #438


📝 Summary of Changes

  • Added max="65535" validation to the Custom SMTP Port input.
  • Added max="65535" validation to the Custom IMAP Port input.
  • Prevents users from entering port numbers outside the valid TCP/UDP port range.
  • Existing functionality and default values remain unchanged.

🏷️ Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • 📝 Documentation update
  • 🎨 UI / Style change
  • 🔧 Chore

🧪 Testing

Steps to test:

  1. Open the Settings page.
  2. Go to the Custom SMTP/IMAP Configuration section.
  3. Verify that both SMTP Port and IMAP Port inputs now have a maximum value of 65535.
  4. Confirm the default values (587 and 993) are unchanged.
  5. Attempt to enter a value greater than 65535 and verify that the browser prevents invalid input.

📸 Screenshots (if applicable)

N/A


✅ Checklist

  • No merge conflicts
  • Changes follow the project guidelines
  • Documentation updated (not applicable)
  • Related issue linked
  • Changes tested locally

Summary by CodeRabbit

  • Bug Fixes
    • Added validation limits to custom SMTP and IMAP port fields, preventing users from entering out-of-range port numbers.
    • Port inputs now accept only values from 1 to 65535, improving form consistency and reducing configuration errors.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e97bae9a-ad32-4aff-afee-5ce3f04d5f78

📥 Commits

Reviewing files that changed from the base of the PR and between 4a33158 and abf0384.

📒 Files selected for processing (1)
  • frontend/settings.html

📝 Walkthrough

Walkthrough

The custom SMTP and IMAP port inputs in the settings form now constrain numeric values to the range 1–65535.

Changes

Custom mailbox port validation

Layer / File(s) Summary
Port input bounds
frontend/settings.html
Adds max="65535" to the custom SMTP and IMAP port number fields while keeping the existing minimum of 1.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 I hop through ports both high and low,
From one to sixty-five-five-five-five I go.
My whiskers twitch, the form looks bright,
No silly port hops out of sight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Only frontend port caps were added; backend serializer validation and SMTP SSL/TLS mutual-exclusion handling from #438 are still missing. Add serializer-level validation for smtp_port and imap_port, and reject invalid SMTP SSL/TLS combinations as requested in #438.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding max validation to SMTP and IMAP port inputs.
Out of Scope Changes check ✅ Passed The changes stay within SMTP/IMAP port validation and do not introduce unrelated edits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LO-092 [Easy]: Custom SMTP/IMAP Configuration Input Validation

1 participant