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

Any one email contains non-ASCII characters return all emails are invalid even valid email present #176

Open
Premanandh-S opened this issue Nov 21, 2017 · 4 comments

Comments

@Premanandh-S
Copy link

Premanandh-S commented Nov 21, 2017

I am using mail gun managed account for sending email and using flanker library for validating emails. Some times many valid emails are not returned in email list validation. Please look into this ASAP.

I have used the following code for validate email list

validate_email_list.py looks like following

import sys
sys.path.append('/opt/third-party-packages')
from flanker.addresslib import address

print address.validate_list(sys.argv[1])

Run above code

python validate_email_list.py '[email protected]Æm,[email protected],[email protected]'

It's working fine when I remove [email protected]Æm

Is this encoding issue ?

@Premanandh-S Premanandh-S changed the title Valid gmail and yahoo emails some times not returned email list validation Valid gmail and yahoo emails are some times not returned from email list validation Nov 21, 2017
@horkhe
Copy link
Member

horkhe commented Nov 22, 2017

Passing a comma separated string to validate_list is suboptimal. Due to grama ambiguity the result may not be what you want it to be. When possible it is always better to pass a list of strings like this: validate_list(['[email protected]Æm', '[email protected]', '[email protected]'])

@Premanandh-S
Copy link
Author

Premanandh-S commented Nov 23, 2017

Not working the following code and show the following error

screen shot 2017-11-23 at 10 23 24 am

File "validate_email_list.py", line 6
SyntaxError: Non-ASCII character '\xc3' in file validate_email_list.py on line 6, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
""

@horkhe
Copy link
Member

horkhe commented Nov 23, 2017

You are using a non-ASCII literal in a file that does not have encoding declared. Add # coding:utf-8 as the first line of your file.

@Premanandh-S
Copy link
Author

Premanandh-S commented Nov 29, 2017

Adding # coding:utf-8 only fixed the syntax error.

Eventually I fixed this issue by remove email which contains non-ASCII characters.

@Premanandh-S Premanandh-S changed the title Valid gmail and yahoo emails are some times not returned from email list validation Any email in list contains non-ASCII characters return all emails are invalid even valid email present Nov 29, 2017
@Premanandh-S Premanandh-S changed the title Any email in list contains non-ASCII characters return all emails are invalid even valid email present Any one email contains non-ASCII characters return all emails are invalid even valid email present Nov 29, 2017
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

No branches or pull requests

2 participants