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

internationalised email addresses #57

Open
rerowep opened this issue Sep 6, 2021 · 4 comments
Open

internationalised email addresses #57

rerowep opened this issue Sep 6, 2021 · 4 comments

Comments

@rerowep
Copy link

rerowep commented Sep 6, 2021

It should be possible to send emails to internationalised email addresses.
Following RFC describes the standard: https://datatracker.ietf.org/doc/html/rfc6531
With the python module smtplib it is already possible to send emails to internationalised email addresses as following:
server.sendmail(from_email, to_email.encode('utf-8'), msg.as_string(), ['SMTPUTF8'])

@lnielsen
Copy link
Member

lnielsen commented Sep 7, 2021

Do you have more information about where the problem occurs? Is that we not able to store this email addresses in Accounts, or is it Invenio-Mail/Flask-Mail that has a problem with it?

@rerowep
Copy link
Author

rerowep commented Sep 27, 2021

It is not possible to send international email because flask mail makes a RFC sanity check in the utils.py::formataddr line 91 function.

    # The address MUST (per RFC) be ascii, so raise a UnicodeError if it isn't.
    address.encode('ascii')

The library libsmtp can send international emails. Following RFC's must be handeled:
https://tools.ietf.org/html/rfc6530 and https://tools.ietf.org/html/rfc6531

https://stackoverflow.com/questions/34040613/how-to-send-an-e-mail-to-the-international-address

@lnielsen
Copy link
Member

lnielsen commented Oct 6, 2021

This is a bit of a bigger task as it requires replacing Flask-Mail extension (which should anyway be done as it is unmaintained), so at this point I'm not sure when the work can be scheduled.

@rerowep
Copy link
Author

rerowep commented May 16, 2022

What's the status for this issue. Unfortunately, we have data with international email addresses in our user database and we can't email these users. Is there already an idea with what flask-mail should be replaced with and could I help with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants