Code Monkey home page Code Monkey logo

Comments (5)

NiKiZe avatar NiKiZe commented on July 20, 2024

Looking more on this, the regexp for getting addresses is to strict.

(.*)\s*<?([A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4})>?

The local part of the address can contain more or less any character, even if .NET does not support it. One char that seams to be missing is +.

The domain part can be both quad dotted ip-addresses (and IPv6 but the format I'm unsure of) as well as ending with .museum.

from s22.imap.

smiley22 avatar smiley22 commented on July 20, 2024

Yea, I know that regex will fail with some addresses which are valid according to RFC 2822.

Proper RFC-compliant validation is so ridiculously complex, it's not worth it all IMO. How many mail servers can actually deal with funny addresses such as "very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual"@strange.example.com anyway.

from s22.imap.

NiKiZe avatar NiKiZe commented on July 20, 2024

I agree, I will try to update for my cases, and also add testcases for those addresses.

from s22.imap.

NiKiZe avatar NiKiZe commented on July 20, 2024

Changed the parser in b852fb1 Did some fixes in 7a9dd8b

The eol problems makes me go mad...
Testscases to come 968939e

from s22.imap.

jstedfast avatar jstedfast commented on July 20, 2024

You guys will absolutely love MimeKit.InternetAddressList.Parse() and TryParse() methods.

They handle everything.

from s22.imap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.