Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change smtp.MailOptions to a pointer #145

Merged
merged 1 commit into from
Jul 22, 2021
Merged

Conversation

kayrus
Copy link
Contributor

@kayrus kayrus commented Jul 15, 2021

Pass a pointer instead of the struct copy.
Will require a corresponding change in https://github.com/emersion/go-smtp-proxy

@kayrus kayrus force-pushed the mail-options branch 2 times, most recently from db377e4 to d65fbc9 Compare July 15, 2021 11:17
@kayrus
Copy link
Contributor Author

kayrus commented Jul 15, 2021

I'm also thinking of parsing the from and rcpt emails via https://pkg.go.dev/net/mail#ParseAddress and return an error, if parsing is failed. Therefore we can pass a *mail.Address pointer to Mail and Rcpt methods instead of the strings.

@foxcpp
Copy link
Collaborator

foxcpp commented Jul 15, 2021

I'm also thinking of parsing the from and rcpt emails via https://pkg.go.dev/net/mail#ParseAddress and return an error, if parsing is failed. Therefore we can pass a *mail.Address pointer to Mail and Rcpt methods instead of the strings.

NACK, mail.Address is for RFC 5322 header values, not SMTP envelope. What mail.Address represents and what mail.ParseAddress would accept is invalid for SMTP.

@foxcpp
Copy link
Collaborator

foxcpp commented Jul 22, 2021

Wondering why this is not merged yet. Since we are breaking stuff all around we can probably merge this too.
@kayrus, can you rebase your PR on master?

@foxcpp foxcpp self-requested a review July 22, 2021 16:54
@emersion
Copy link
Owner

Acked-by me

@kayrus
Copy link
Contributor Author

kayrus commented Jul 22, 2021

rebased

Copy link
Collaborator

@foxcpp foxcpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (server example in README needs an update too but I will take care of it)

@foxcpp foxcpp merged commit 64a19b7 into emersion:master Jul 22, 2021
@kayrus kayrus deleted the mail-options branch July 22, 2021 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants