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

Add a toggle to skip email validation #97

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

meain
Copy link
Contributor

@meain meain commented Dec 19, 2023

This PR adds an option UseProvidedAddress which when set directly uses the email provided by the user without validating or trying to parse out its components.

Closes #95

@meain
Copy link
Contributor Author

meain commented Dec 19, 2023

@xhit Quick question. I saw that you were using address.Address at certain places and address.String() at other. Is there a reason why we are doing it differently at different places.

If we use address.String() at all the paces, I think #11 also gets handled.

@xhit
Copy link
Owner

xhit commented Dec 19, 2023

@meain address.Address contains only the email, with this we add to recipients to send a SMTP RCPT command because we only need the address here. The address.String() is the full address, with the name if provided, and the address enclosed by < and >, used to create a RFC822 formatted message to use un SMTP DATA command, also, dev can get it using GetMessage method.

Not all addresses in the message are populated by default, the BCC for example, are added to recipients for the RCPT command, but not in the message for the DATA command for security, with this, the recipients will not know the BCC addresses.

email.go Show resolved Hide resolved
@meain
Copy link
Contributor Author

meain commented Dec 19, 2023

address.Address contains only the email, with this we add to recipients to send a SMTP RCPT command because we only need the address here.

Hmm, I see. Would you be open to changing it to accepting the full address. Would it cause issues?

@xhit
Copy link
Owner

xhit commented Dec 19, 2023

Hmm, I see. Would you be open to changing it to accepting the full address. Would it cause issues?

I can't, RCPT only receives the address, not full address.

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (3a06b6e) 52.51% compared to head (c70ebcd) 52.65%.

Files Patch % Lines
email.go 60.00% 7 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
+ Coverage   52.51%   52.65%   +0.14%     
==========================================
  Files           7        7              
  Lines        1293     1297       +4     
==========================================
+ Hits          679      683       +4     
  Misses        545      545              
  Partials       69       69              
Flag Coverage Δ
unittests 52.65% <60.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@meain
Copy link
Contributor Author

meain commented Dec 22, 2023

@xhit Following our discussion, I've added a note in the readme and rebased the code on latest master. Let me know if you need anything else from the PR.

@xhit xhit merged commit e26e0d1 into xhit:master Dec 22, 2023
50 checks passed
@xhit
Copy link
Owner

xhit commented Dec 22, 2023

@meain sorry, I'm currently on vacations, I will tag a new version after that, you can use master branch. Thanks!

@meain
Copy link
Contributor Author

meain commented Dec 23, 2023

Thanks @xhit. No rush on the tag :D

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.

Toggle to accept incomplete email address
3 participants