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

feat: Allow specifying Sender Name in smtp.from_address #1100

Merged
merged 5 commits into from
Mar 1, 2021

Conversation

zhming0
Copy link
Contributor

@zhming0 zhming0 commented Feb 27, 2021

Proposed changes

Currently, there is no way to configure Email from name for Kratos.

By checking ory/mail's source code, I am convinced that Kratos is equipped with the ability to handle RFC-5322 mailbox format.

This PR introduces a new optional from_name properties under smtp.from_name.

Checklist

  • I have read the contributing guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further comments

If this looks alright, I am happy to raise another PR to update doc or just do it as part of this change too.

@CLAassistant
Copy link

CLAassistant commented Feb 27, 2021

CLA assistant check
All committers have signed the CLA.

@zhming0 zhming0 changed the title Allow RFC-6531 email address in smtp.from_address feat: Allow RFC-6531 email address in smtp.from_address Feb 27, 2021
@zepatrik
Copy link
Member

I am not sure if our jsonschema library supports format: idn-email. Can you please add a test here: https:/ory/kratos/tree/master/test/schema
Also, it would be good to have this added in the integration test: https:/ory/kratos/tree/master/test/e2e/cypress/integration/profiles/email
There should be two cases, one with, and one without the sender name.
Thanks a lot 👍

@zhming0 zhming0 changed the title feat: Allow RFC-6531 email address in smtp.from_address feat: Allow specifying Sender Name in smtp.from_address Mar 1, 2021
@zhming0
Copy link
Contributor Author

zhming0 commented Mar 1, 2021

@zepatrik thanks. You are right, the current jsonschema tool does not support idn-email, and I also misunderstood that idn-email would allow Bob <[email protected]>. 🤦‍♂️ 🤦‍♂️

Anyway, I have reworked this PR entirely and added a proper integration test.

Please let me know if this suffice.

Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

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

Nice, this looks good to me 👍

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Awesome, thank you! 🎉 Your contribution makes Ory better :)

@aeneasr aeneasr merged commit 5904fe3 into ory:master Mar 1, 2021
@zhming0 zhming0 deleted the rfc-6531-from-address branch March 1, 2021 22:30
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.

4 participants