Add support for display name in email sender#23
Merged
umputun merged 2 commits intogo-pkgz:masterfrom Dec 3, 2025
Merged
Conversation
Contributor
Author
|
Hey! I created this as a fix to being able to use a display name for the from address in Remark42. Without this I am getting 501 errors from the SMTP server when using a from address on the format |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for handling email display names by ensuring only the email address is used in the MAIL FROM command to avoid SMTP errors.
- Added a new test (TestEmail_SendWithDisplayName) to validate display name handling.
- Modified the MAIL FROM logic to extract just the email address using a new helper, extractEmailAddress.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| email_test.go | Introduces tests for verifying proper extraction of the email address from a display name format. |
| email.go | Implements extraction logic to filter out the display name when calling the SMTP client. |
Only use the email address in the MAIL FROM command to avoid SMTP errors.
3d0b5b9 to
fb74071
Compare
paskal
approved these changes
Dec 3, 2025
…ests - Replace regex with net/mail.ParseAddress for RFC 5322 compliance - Apply extractEmailAddress to recipients (params.To) for consistency - Add strings.TrimSpace to handle whitespace in pasted addresses - Add table-driven unit tests covering various email formats - Fix import ordering and normalize comments
fb74071 to
0bdc77c
Compare
Contributor
|
LGTM, will merge and update remark42 soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only use the email address in the MAIL FROM command to avoid SMTP errors.