mailer icon indicating copy to clipboard operation
mailer copied to clipboard

Introduce validator on Address()

Open enricobenedos opened this issue 4 years ago • 1 comments

Good morning,

I spent some time to understand why some users was experiencing some problems with my app when sending mails. This was the error:

After sending MAIL FROM:<[email protected]>, response did not start with any of: [2].
Response from server: < 550 5.1.0 yIhdkhTPKKpB1yIhekj1KR invalid domain

After some research I found it was simply caused by a tab in the Address() name parameter.

Can it be an idea to create a validator that does not permit to introduce wrong space in the name string?

Thanks

enricobenedos avatar Jan 09 '21 18:01 enricobenedos

mailer should definitely provide a possibility for address-validation.

Earlier versions had a validator which was RFC conform: https://github.com/kaisellgren/mailer/blob/cb1a63610057cdd8d04950af7e0ccb004c635aa7/lib/src/address.dart

I think that we must allow different validators. A lot of (RFC) valid addresses shouldn't be allowed.

close2 avatar Jan 29 '21 00:01 close2