Skip to content

fix: trim whitespace from SMTP server address before connecting#381

Open
nikolainyegaard wants to merge 1 commit intojellyfin:masterfrom
nikolainyegaard:fix/trim-smtp-server-address
Open

fix: trim whitespace from SMTP server address before connecting#381
nikolainyegaard wants to merge 1 commit intojellyfin:masterfrom
nikolainyegaard:fix/trim-smtp-server-address

Conversation

@nikolainyegaard
Copy link
Copy Markdown

When a user pastes an SMTP server hostname that has a trailing or leading space (easy to do when copying from a browser), ConnectAsync fails with a DNS error. This one-line fix calls .Trim() on the server address before the connection is made.

Users copying a hostname from a browser or config file may inadvertently
include a leading or trailing space. ConnectAsync treats the raw string
literally, causing a DNS lookup failure with no obvious error message.
Calling .Trim() on SmtpServer before passing it to ConnectAsync prevents
this silent failure.
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.

1 participant