Adireshin Imel mai inganci

Sanya hotuna 1948865 s

Dole ne in yi wasu tono a yau don gano shi, amma ko kun san menene ingancin adadin adireshin imel? Haƙiƙa an ragargaza shi parts Suna@Domain.com. Wannan a cewar RFC2822.

  1. Suna na iya zama haruffa 1 zuwa 64
  2. Yankin na iya zama haruffa 1 zuwa 255.

Wow… wannan yana nufin cewa wannan na iya zama ingantaccen adireshin imel:


loremaipsumadolorasitaametbaconsectetueraadipiscin
gaelitanullamc @ loremaipsumadolorasitaametbaconsect
etueraadipiscingaelitcaSedaidametusautanisiavehicu
laaluctuscaPellentesqueatinciduntbadiamaidacondimn
tumarutrumbaturpisamassaactionctetueraarcubaeuatin
ciduntaliberoaaugueavestibulumaeratcaPhasellusatin
ciduntaturpisaduis.com

Gwada gwadawa a kan katin kasuwanci! Abin ban mamaki, yawancin filayen adireshin imel suna iyakance ga haruffa 100 akan yanar gizo. Wannan ba shi da inganci. Idan kuna son inganta adireshin imel don ingantaccen gini ta hanyar amfani da PHP, na sami wannan ɗan tsage a kan yanar gizo:

http://derrick.pallas.us/email-validator/ # Lasisi: lasisi kyauta na ilimi 2.1 # Saka: 2006-12-01a idan (! ereg (''. '^'. '- -! # $% & \ '* + / 0-9 =? AZ ^ _a-z {|} ~]'. '(\\.? [-! # $% & \' * + / 0-9 =? AZ ^ _a-z { |} ~]) * '.' ''. '[a-zA-Z] (-? [a-zA-Z0-9]) *'. '(\\. [a-zA-Z] (- ? [a-zA-Z0-9]) *) + '.' $ ', $ email)) dawo karya; jerin ($ na gida, $ yanki) = raba ("@", $ email, 2); idan (strlen ($ na gida)> 64 || strlen ($ domain)> 255) ya dawo karya; idan ($ duba &&! gethostbynamel ($ domain)) dawo da ƙarya; dawo gaskiya; # KARSHE ######}

9 Comments

  1. 1
  2. 2

    Ee, Na lura da rashin bin sauran hanyoyin magance RFC kuma. Na lura, kodayake, har ma da wannan regex bai dace ba kuma ba daidaitacce bane. Na tuna karanta ainihin regex (kyale <,>,, da sauransu) yayi ƙarfi sosai don yawancin matakai.

    Koyaya, an rubuta taƙaitacce kuma tabbas maganin da yakamata ya zama karɓaɓɓe ga kowane aikace-aikacen imel ɗin imel.

    Godiya, Sake!
    Doug

  3. 3

    Abin takaici, na danganta wannan shafin zuwa RFC mara kyau (2821 maimakon 2822) amma an gyara hakan. Cketsunƙunfan kusurwa ba za su iya zama ɓangare na ɓangarorin yanki ko yanki na adireshin imel ba; maimakon haka, suna wakiltar wuraren tokenization, watau ana iya amfani da su don kewaye adireshin imel (alal misali a cikin mai karanta wasikun ku) daidai saboda ba za su iya zama ɓangare na adireshin ba.

    Abu daya da aikina baya yi shine damuwa game da hanyar adiresoshin imel da aka faɗo - inda ɓangaren gida ya bayyana a cikin maganganu biyu - saboda ainihin RFC2821 ya ce babu wanda ya isa ya rubuta adireshin su ta wannan hanyar. (Nayi imanin cewa fom din yana dacewa ne da baya kuma yanzu ya zama mummunan aiki.)

  4. 4

    A zahiri RFC2821 NE madaidaicin tunani don tsayin adireshin imel. Na same shi a wurin, amma ba a cikin RFC 2822 ba.

  5. 5

    Akwai ƙuntatawa a cikin RFC 2821 akan tsawon adireshi a cikin MAIL da umarnin RCPT na haruffa 256. Matsakaicin babba akan tsayin adireshin yakamata a ɗauka ya zama 256.

    - Source: RFC 3696 Errata

    Har ila yau, saboda RFC 2181 ya ce "Cikakken sunan yankin ya iyakance ga octets 255", ana ta maimaita fassarar da mutane (ciki har da marubutan wasu RFCs) ma'ana cewa sunayen yanki na iya zama tsawon 255. Amma RFC2181 yana magana ne game da wakilcin tsarin wakilcin DNS akan waya, ba haruffa masu bugawa ba.

    Matsakaicin tsayin sunan yanki shine 253 chars (254 gami da ɗigon da ke biye, octets 255 akan waya tare da ƙare aikin banza). Kuma wannan shine abin da BIND da DiG ke aiwatarwa.

  6. 6
  7. 7
  8. 8

Me kuke tunani?

Wannan shafin yana amfani da Akismet don rage spam. Koyi yadda aka sarrafa bayanan bayaninka.