• Blackmist@feddit.uk
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    I don’t think it really matters what the standard is, because you’ll be completely limited by some 25 year old bit of Regex from Stack Overflow that every web developer ever has implemented into their form sanity checks.

  • CommanderCloon@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 month ago

    Question 5 is incorrect, name@example is a fully valid email address, even after RFC 2822

    The spec of RFC 2822 defines an address (3.4.1) as:

    local-part "@" domain
    

    domain is defined (3.4.1) as:

    domain = dot-atom / domain-literal / obs-domain
    

    dot-atom is defined (3.2.4) as:

    dot-atom = [CFWS] dot-atom-text [CFWS]
    dot-atom-text = 1*atext *("." 1*atext)
    

    1*atext meaning at least 1 alphanumeric character, followed by *("." 1*atext) meaning at least 0 "." 1*atext


    If tomorrow, google decided to use its google top-level domain as an email domain, it would be perfectly valid, as could any other company owning top-level domains

    Google even owns a gmail TLD so I wouldn’t even be surprised if they decided to use it

      • DaPorkchop_@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        1 month ago

        Yes, the top-level domain is still just a domain. I’m not aware of any public Internet services which are reachable from a TLD directly, and it’s strongly discouraged by ICANN, but there isn’t any technical limitation preventing e.g. someone at Verisign from setting up example@com.

      • mobotsar@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 month ago

        In response to your edit.

        Yes, or countries could use their cctld, e.g. email@us or noreply@uk.

        Or any tld owner could do the same with theirs, of course.

    • HereIAm@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      1 month ago

      I don’t know if they changes the answer to the question, but it now says name@example is valid.

      • CommanderCloon@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        1 month ago

        It does say it’s valid, but also that it’s obsolete, and while the RFC does define valid but obsolete specs, there is nothing defining domains without a dot as obsolete, and it is in fact defined in the regular spec, not the obsolete section

  • irish_link@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    THIS THING IS STUPID!!!

    Or it’s just me that is the fool. Thanks for sharing. I just learned about 9 new things.

    • rtxn@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      All of the modern internet is built on the decaying carcasses of temporary solutions and things that seemed like a good idea at the moment but are now too widely used to change.

  • Frezik@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    Two of my “favorite” features it didn’t even touch on. You can have nested comments:

    foo(one(two(three(four(five(six(seven)))))))@example.com
    

    This will actually fail on that big email regex that gets copied around (originally from Mastering Regular Expressions in 1997), because it can only handle comment nesting to a depth of six. It is actually possible to do indefinite nesting now with recursive regex, but it was developed before that feature existed.

    RFC822 also allows routing addresses through multiple servers:

    <@foo.example.com@bar.example.com:123@example.com>
    

    But this is almost always denied on modern email servers because it was abused by spammers.

  • TomasEkeli@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    1 month ago

    I don’t validate emails, I test them.

    That’s your email? OK, what did we send it? if we couldn’t send to it or the user can’t read it there’s no reason to accept it.

    OK, maybe I do some light validation first, but I don’t trust the email address just because it’s email-address-shaped.

    • tyler@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      1 month ago

      You shouldn’t be validating emails yourself anyway. Use a library or check for only the @ and then send an email confirmation.

      • zurohki@aussie.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 month ago

        Even if it’s a completely valid address and the domain exists, they still might’ve fat fingered the username part. Going to extreme lengths to validate email addresses is pointless, you still have to send an email to it anyway.

    • Not a newt@piefed.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      13/21 here. Mostly got hung up on several “this was valid in earlier RFC, and later removed” kind of situations. There are several where I picked the correct answer, but where I know many websites that won’t accept it as valid, and that’s not even the more esoteric ones.

  • MonkderVierte@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 month ago
    My top five from this (all valid):
    • ":()␣::&␣;:"@example.com # fork bomb
    • 👉@👈 and poop@[💩]
    • “@”@[@]
    • c̷̨̈́i̵̮̅l̶̠̐͊͝ȁ̷̠̗̆̍̍n̷͖̘̯̍̈͒̅t̶͍͂͋ř̵̞͈̓ȯ̷̯̠-̸͚̖̟͋s̴͉̦̭̔̆̃͒û̵̥̪͆̒̕c̸̨̨̧̺̎k̵̼͗̀s̸̖̜͍̲̈́͋̂͠@example.com
    • fed-up-yet@␣example.com␣ # ␣ = whitespace
  • isaacd@lemmy.world
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    1 month ago

    Let us recite the email validator’s oath:

    If it has something before the @, something between the @ and the ., and something after the ., it’s valid enough.