[{"data":1,"prerenderedAt":383},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2011\u002F03\u002F16\u002Fa-in-an-e-mail-is-valid-can-t-we-stop-using-validators-that-don-t-follow-the-standard\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":370,"date":371,"description":213,"embedImage":370,"extension":372,"image":370,"intro":370,"meta":373,"navigation":374,"path":375,"seo":376,"series":370,"sitemap":377,"stem":378,"tags":379,"__hash__":382},"content\u002F2011\u002F03\u002F16\u002Fa-in-an-e-mail-is-valid-can-t-we-stop-using-validators-that-don-t-follow-the-standard-.md","A + in an e-mail is valid. Can't we stop using validators that don't follow the standard?",{"type":208,"value":209,"toc":366},"minimark",[210,214,220,223,246,252,257,260,263,288,291,295,298,309,312,318,321,324,327,332,335,338,349,354,363],[211,212,213],"p",{},"This is something that has long irritated. Websites that use form validation or similar that rejects e-mail with a + sign in the left part.",[211,215,216],{},[217,218,219],"strong",{},"Background",[211,221,222],{},"Why would you want to? Well - quite a lot of e-mail servers (including gmail - which we'll use for examples here) take:",[224,225,226,234,240],"ul",{},[227,228,229],"li",{},[230,231,233],"a",{"href":232},"mailto:foo@gmail.com","foo@gmail.com",[227,235,236],{},[230,237,239],{"href":238},"mailto:foo+bar@gmail.com","foo+bar@gmail.com",[227,241,242],{},[230,243,245],{"href":244},"mailto:foo+whatever_you_want@gmail.com","foo+whatever_you_want@gmail.com",[211,247,248,249,251],{},"All of these will be delivered to ",[230,250,233],{"href":232},". This allows you to give unique e-mails to each site out there while still only needing the one account - makes filtering in gmail easier, and allows you to track who's selling what to others too ;)",[211,253,254],{},[217,255,256],{},"Standards",[211,258,259],{},"What says that the + is valid?",[211,261,262],{},"E-mail addresses are regulated by a set of RFC documents.",[211,264,265,266,275,276,281,282,287],{},"The original, ",[230,267,274],{"href":268,"rel":269,"target":273},"http:\u002F\u002Fwww.faqs.org\u002Frfcs\u002Frfc822.html",[270,271,272],"nofollow","noopener","noreferer","_blank","RFC822",", this was replaced by ",[230,277,280],{"href":278,"rel":279,"target":273},"http:\u002F\u002Fwww.faqs.org\u002Frfcs\u002Frfc2822.html",[270,271,272],"RFC2822"," and finally this was updated for internationalization in ",[230,283,286],{"href":284,"rel":285,"target":273},"http:\u002F\u002Fwww.faqs.org\u002Frfcs\u002Frfc5335.html",[270,271,272],"RFC5335",".",[211,289,290],{},"In 2822 - the relevant section is 3.4.1.",[292,293,294],"blockquote",{},"An addr-spec is a specific Internet identifier that contains a\n   locally interpreted string followed by the at-sign character (\"@\",\n   ASCII value 64) followed by an Internet domain.  The locally\n   interpreted string is either a quoted-string or a dot-atom.  If the\n   string can be represented as a dot-atom (that is, it contains no\n   characters other than atext characters or \".\" surrounded by atext\n   characters), then the dot-atom form SHOULD be used and the\n   quoted-string form SHOULD NOT be used. Comments and folding white\n   space SHOULD NOT be used around the \"@\" in the addr-spec.",[211,296,297],{},"What this says is that the valid chars for the local-part (left of the @ sign) are made up of one of the following:",[224,299,300,303,306],{},[227,301,302],{},"dot-atom",[227,304,305],{},"quoted-string",[227,307,308],{},"obs-local-part",[211,310,311],{},"If you dig through - dot-atom is made up from dot-atom-text - which in turn is made up of atext.",[292,313,314],{},[315,316,317],"pre",{},"atext           =       ALPHA \u002F DIGIT \u002F ; Any character except controls,\n                        \"!\" \u002F \"#\" \u002F     ;  SP, and specials.\n                        \"$\" \u002F \"%\" \u002F     ;  Used for atoms\n                        \"&\" \u002F \"'\" \u002F\n                        \"*\" \u002F \"+\" \u002F\n                        \"-\" \u002F \"\u002F\" \u002F\n                        \"=\" \u002F \"?\" \u002F\n                        \"^\" \u002F \"_\" \u002F\n                        \"`\" \u002F \"{\" \u002F\n                        \"|\" \u002F \"}\" \u002F\n                        \"~\"\n",[211,319,320],{},"All of these are valid.",[211,322,323],{},"822 used a slightly different layout - local-part is made up of atom or quoted string, atom is one or more \"any CHAR except specials, SPACE and CTLs\" - and the specials do not include +.",[211,325,326],{},"5332 replaces atext with utf8-atext - guess what - the + is still there ;)",[211,328,329],{},[217,330,331],{},"Issues",[211,333,334],{},"There seem to be a lot of broken validators out there that have an incorrect set of characters. The one that gives the most issues seems to be the + sign. Not sure why - but it seems quite a common issue.",[211,336,337],{},"Even worse is when it's allowed on the registration page but rejected by the login page (where e-mail is used at login).",[211,339,340,341,345,346,348],{},"A smaller issue are sites that fail to handle the encoding of this when displaying it (a + urldecodes to a space - so you have to encode it first). This is just broken webpage design - but when the confirmation page displays the address as \"foo ",[230,342,344],{"href":343},"mailto:bar@gmail.com","bar@gmail.com","\" instead of \"",[230,347,239],{"href":238},"\" and the form wizard fails to complete with an email validation error on the confirmation page (usually without the ability to edit the field) - that's just as annoying.",[211,350,351],{},[217,352,353],{},"Summary",[211,355,356,357,362],{},"If you're going to validate e-mail addresses (a good idea) then please use a validation library that is correct. Don't assume that you know what an e-mail looks like - the valid combinations are wildly more varied than most people realize. Don't assume a simple regular expression is good enough (see ",[230,358,361],{"href":359,"rel":360,"target":273},"http:\u002F\u002Fwww.ex-parrot.com\u002Fpdw\u002FMail-RFC822-Address.html",[270,271,272],"this regex",").",[211,364,365],{},"Oh - and asking your users to change their e-mail due to your broken validation is not something that makes them feel good towards your brand!",{"title":367,"searchDepth":368,"depth":368,"links":369},"",2,[],null,"2011-03-16 06:53:59 +0100","md",{},true,"\u002F2011\u002F03\u002F16\u002Fa-in-an-e-mail-is-valid-can-t-we-stop-using-validators-that-don-t-follow-the-standard",{"title":206,"description":213},{"loc":375},"2011\u002F03\u002F16\u002Fa-in-an-e-mail-is-valid-can-t-we-stop-using-validators-that-don-t-follow-the-standard-",[380,381],"email","rfc","Gr1lYh_44ctCN4y2A5UtkvNqrmaFXTkKxyUfXk5biMo",1775293013771]