Validate emails #63

Open
opened 5 months ago by max.mehl · 6 comments
Owner

When sending out confirmation mails, we should validate whether these are actually legit. We get a number of bounces when bots just type in random addresses there.

py3-validate-email is also used in fsfe-cd

When sending out confirmation mails, we should validate whether these are actually legit. We get a number of bounces when bots just type in random addresses there. `py3-validate-email` is also used in fsfe-cd
max.mehl added the
prio:mid
label 5 months ago

I think the marshmallow library that's already in use can do email validation:

https://marshmallow.readthedocs.io/en/stable/quickstart.html#validation

Some fields, such as the Email and URL fields, have built-in validation.

from marshmallow import ValidationError

try:
   result = UserSchema().load({"name": "John", "email": "foo"})
except ValidationError as err:
   print(err.messages)  # => {"email": ['"foo" is not a valid email address.']}
   print(err.valid_data)  # => {"name": "John"}

I can have a go at this one after Christmas, if you like :)

I think the `marshmallow` library that's already in use can do email validation: > https://marshmallow.readthedocs.io/en/stable/quickstart.html#validation > > Some fields, such as the Email and URL fields, have built-in validation. > ``` > from marshmallow import ValidationError > > try: > result = UserSchema().load({"name": "John", "email": "foo"}) > except ValidationError as err: > print(err.messages) # => {"email": ['"foo" is not a valid email address.']} > print(err.valid_data) # => {"name": "John"} > ``` I can have a go at this one after Christmas, if you like :)
Owner

@seabass that's what we already do anyway. However this checks only whether the email address is syntactically correct, not whether it actually exists.

py3-validate-email checks an email address for existence.

@seabass that's what we already do anyway. However this checks only whether the email address is *syntactically* correct, not whether it actually exists. `py3-validate-email` checks an email address for existence.

Ah, interesting! Thank you for explaining, @reinhard.

Ah, interesting! Thank you for explaining, @reinhard.
Poster
Owner

Would you still like to take a shot at this @seabass? You could tale a look at the fsfe-cd project how it's done there.

What I heard from Reinhard is that the connection from the container to the mail server of the checked email is not TLS encrypted which may lead to error messages. The newest version of py3-validate-email supports that though, but it may need some extra flags that we haven't set in fsfe-cd yet.

Would you still like to take a shot at this @seabass? You could tale a look at the fsfe-cd project how it's done there. What I heard from Reinhard is that the connection from the container to the mail server of the checked email is not TLS encrypted which may lead to error messages. The newest version of py3-validate-email supports that though, but it may need some extra flags that we haven't set in fsfe-cd yet.
Owner

FWIW, it doesn't need extra flags, the newer versions try TLS automatically.

FWIW, it doesn't need extra flags, the newer versions try TLS automatically.

Would you still like to take a shot at this @seabass? You could tale a look at the fsfe-cd project how it's done there.

Yes, I'll have a go! :) Thanks for the suggestion; I'll look at fsfe-cd.

> Would you still like to take a shot at this @seabass? You could tale a look at the fsfe-cd project how it's done there. Yes, I'll have a go! :) Thanks for the suggestion; I'll look at `fsfe-cd`.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.