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

Escaping of recipient name #281

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

newearthmartin
Copy link
Contributor

@newearthmartin newearthmartin commented Sep 18, 2019

In some cases, the subscription.name will contain special characters that cause the outgoing email to fail such as @ and ,.

Such real world example: when name is 'martin@' and email is [email protected], it creates this address for sending 'martin@ <[email protected]>', which fails.

I added a filter for these characters: @, , and ; in the get_address(name, email) method.
There could be more, these are the real life cases that I faced.

I also considered changing it in the 'cleaning' part of subscription.save so that these faulty names don't even go into the database, but I decided to let them in the database and just filter them out when sending. Feel free to put your opinions about this in this PR.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 88.644% when pulling af34a4c on newearthmartin:invalid_chars into 30c3ec3 on dokterbob:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 88.644% when pulling af34a4c on newearthmartin:invalid_chars into 30c3ec3 on dokterbob:master.

@dokterbob
Copy link
Collaborator

Thanks for the contrib!

However, it seems to me that these characters should be escaped rather than removed. It's 2020, we have UTF-8 these days and it happens to be that most of the world doesn't live in ASCII anymore. ;)

@newearthmartin
Copy link
Contributor Author

Oh! But this isn't about Unicode or ascii. It is about characters like @ or . in the recipient's name, when these characters typically go in the recipient's address. You can try it and see.

@dokterbob
Copy link
Collaborator

dokterbob commented Jan 7, 2020 via email

@dokterbob dokterbob changed the title removing invalid chars Escaping of recipient name Oct 24, 2020
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.

3 participants