• marzhall@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    23 minutes ago

    I scored 16/21 on https://e-mail.wtf/ and all I got was this lousy text to share on social media.

    Damn, and here I thought I had this locked down because I was salty that so many places struggle with + in the email addy. But my god, there’s comments?

  • TomasEkeli@programming.dev
    link
    fedilink
    arrow-up
    16
    ·
    2 hours 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
      11
      ·
      3 hours 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
        ·
        56 minutes 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.

  • Cam@scribe.disroot.org
    link
    fedilink
    arrow-up
    14
    ·
    3 hours ago

    13 right answers and I didn’t expect so many lol

    I’ll never validate some of the 💩 I’ve learnt today.

  • thomasloven@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    2 hours ago

    If qoutes are removed and internal spaces are invalid, how could ":(){␣:|:&␣};:"@example.com be valid?

  • Blackmist@feddit.uk
    link
    fedilink
    English
    arrow-up
    39
    ·
    4 hours 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.

    • Frezik@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      12
      ·
      4 hours ago

      The main one that gets passed around will match the weirdness fine. In fact, it probably matches things you don’t want, anyway.

      A signin/registration form really only needs to do sanity checks to get rid of obviously bad addresses. You’ll have to send a round-trip email confirmation message to make sure the email is real, anyway, so why bother going into great detail? Just check that there’s an ‘@’ symbol and a dot in the domain. Most of the rest is wanking off.

      • Dremor@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        4 hours ago

        A domaine without tld (me@home) is a valide address. I saw an email server being used as a mqtt-like server this way (it is very old and predate those software).

        • Frezik@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          2
          ·
          3 hours ago

          An address without a domain is irrelevant for a signin/registration form. Which is like 90% of the code being written in the wild to validate addresses.

          If you’re writing an email server, then you need to care about all these details. Most of us never will.

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

                Don’t be ridiculous, I’m going to use an open source password manager to fill an IPv6 address for my email server into the DoorDash signin page.

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

                  I know you’re being facetious, but I’m thinking through the implications of someone actually doing this. ISPs aren’t always handing out static IPv6 prefixes for some damn reason, so you can’t count on that address staying the same when self-hosting. Even if you can, you don’t know what will happen when you change ISPs.

                  So yeah, really bad idea regardless.

  • Speiser0@feddit.org
    link
    fedilink
    arrow-up
    15
    ·
    5 hours ago

    Pretty much everything I’ve seen in e-mail is needlessly complicated and weird. So of course addresses are as well.

  • CommanderCloon@lemmy.ml
    link
    fedilink
    arrow-up
    49
    ·
    edit-2
    7 hours 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

    • HereIAm@lemmy.world
      link
      fedilink
      arrow-up
      15
      ·
      6 hours 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
        21
        ·
        5 hours 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

      • snooggums@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        6 hours ago

        It says valid but obsolete, which sounds like a contradiction to me.

        This is technically valid but considered obsolete. RFC 822 allowed domains without dots, but RFC 2822 made this obsolete.

        Do email suffix not indicate a different domain like .org and .com for websites?