Skip to content

Test SMTP connection fails when no port is specified #41643

Closed

Description

@rmartinc

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

admin/api

Describe the bug

This is a regression created by #39486. When no port is specified the condition added for that issue incorrectly compares the empty string "" with the port 25. Check this line. Therefore the test thinks that the server is different (different port) and the password is not recovered from the configuration. This finishes with a login error instead of a successful test.

The root cause seems to be that the port is sent by the console as null (in json "port": null) and that makes settings.getOrDefault("port", "25") return null. So I will use Optional or similar.

The easy workaround is just specify the default port to 25 in the admin console.

Version

26.3.2

Regression

  • The issue is a regression

Expected behavior

The test should work OK.

Actual behavior

Test fails with incorrect password as the password is not recovered from the configuration.

How to Reproduce?

Just configure a SMTP server in default port 25 without specifying it in teh configuration. After saving , reload the smtp config and test again. It will fail with invalid credentials.

Anything else?

No response

Activity

  1. self-assigned this
    on Aug 4, 2025
  2. added a commit that references this issue on Aug 5, 2025
    4926fc9
  3. 5 remaining items

  4. added a commit that references this issue on Aug 8, 2025
    b41f579
  5. added a commit that references this issue on Aug 8, 2025
    3f669f8
  6. added a commit that references this issue on Aug 12, 2025
    dad939b
  7. added a commit that references this issue on Aug 13, 2025
    d2d0172
  8. added a commit that references this issue on Aug 13, 2025
    0e23856
  9. added a commit that references this issue on Jan 19, 2026
    4b3f5de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions