Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Address Validator

 AfterLogic Forum : MailBee.NET Address Validator
Subject Topic: Regex check denies existing address Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
pfrigge
Newbie
Newbie


Joined: 24 May 2019
Online Status: Offline
Posts: 3
Posted: 24 May 2019 at 4:00am | IP Logged Quote pfrigge

Hi,
we don't have the address validator licensed, but I'm posting in this thread since I assume, that MailBee.SmtpMail.Smtp.ValidateEmailAddressSyntax("address@example.com") uses the same code internally. This function returns false for addresses that actually exist but have the following structure: a.b.-test@t-online.de

A period followed by a hyphen (and also the other way around) seems to be the problem. But as I already mentioned, there are existing addresses using this format and all online verification services that I tested confirmed that such addresses actually are valid.

So is it possible to modify the regex check? This is a really big issue for us because we can't explain to our customers that this address gets rejected because it's to "strange" though it exists.
Back to Top View pfrigge's Profile Search for other posts by pfrigge
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 24 May 2019 at 6:55am | IP Logged Quote Alex

Hi,

Edge cases are up to the developer's liking. There is no strict rule in this situations so you can easily tweak the this behavior by adjusting EmailAddressValidator.RegexPattern. It's default value is the most commonly accepted pattern of an email address but you can edit it (it's read/write property) how you see fit. For instance, you can use less strict and more forgiving pattern like ".+@.+".

Note that there is no such property for Smtp.ValidateEmailAddressSyntax method (it's simply not needed because the method is very simple and just calls Regex.IsMatch). So you can call Regex.IsMatch against your own pattern.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
pfrigge
Newbie
Newbie


Joined: 24 May 2019
Online Status: Offline
Posts: 3
Posted: 03 June 2019 at 2:25am | IP Logged Quote pfrigge

Hi,

we decided to omit the syntax validation in our sending process because the smtp server will reject invalid recipients anyway.
And for editing email addresses we will probably use a less strict regex pattern as you suggested.

Thanks!
Back to Top View pfrigge's Profile Search for other posts by pfrigge
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide