Ubude beDilesi ye-imeyile

Iidipozithi iifoto 1948865 s

Kwafuneka ndenze ukumba namhlanje ukuze ndiyifumane, kodwa ubusazi ukuba bubuphi ubude bedilesi ye-imeyile? Inene yaphulwe yangamacandelo… Igama@Domain.com. Oku kuhambelana I-RFC2822.

  1. Igama linokuba ngoonobumba aba-1 ukuya kuma-64.
  2. Isizinda sinokuba ngabalinganiswa aba-1 ukuya kuma-255.

Wow… oko kuthetha ukuba oku kunokuba yidilesi ye-imeyile efanelekileyo:


loremaipsumadolorasitaametbaconsectetueraadipiscin
Lumka @loremaipsumadolorasitaametbaconsect
etueraadipiscingaelitcaSedaidametusautanisiavehicu
I-laaluctuscaPellentesqueatinciduntbadiamaidacondimn
tumarutrumbaturpisamassaaconsectetueraarcubaeuatin
ciduntaliberoaaugueavestibulumaeratcaPhasellusatin
ciduntaturpisaduis.com

Zama ukuyifaka kwikhadi leshishini! Ngelishwa, uninzi lweedilesi ze-imeyile zikhawulelwe kubalinganiswa abali-100 kwiwebhu. Ngokuqinisekileyo ayisebenzi. Ukuba ungathanda ukuqinisekisa idilesi ye-imeyile yolwakhiwo olufanelekileyo usebenzisa i-PHP, ndiyifumene le snippet kumnatha:

http://derrick.pallas.us/email-validator/ # Ilayisensi: Ilayisensi yasimahla yezifundo 2.1 # Inguqulelo: 2006-12-01a ukuba (! 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]) *) + '.' $ ', $ imeyile)) buyela ubuxoki; Uluhlu ($ lwasekhaya, idomain) = ukwahlula ("@", imeyile yeedola, 2); ukuba (strlen ($ local)> 64 || strlen ($ domain)> 255) buyela ubuxoki; ukuba ($ jonga &&! gethostbynamel ($ domain) buyela ubuxoki; buyela yinyani; # ISIPHELO ###### }

9 Comments

  1. 1
  2. 2

    Ewe, ndiye ndaphawula ukunqongophala kokuthotyelwa kwezinye izisombululo kwiRFC ngokunjalo. Ndiqaphele, nangona kunjalo, ukuba le regex ayihambelani kwaye ayisiyomgangatho. Ndiyakhumbula ndifunda eyona regex (ivumela <,>,, njl) inamandla kakhulu kwiinkqubo ezininzi.

    Nangona kunjalo, ibhalwe ngokuchanekileyo kwaye ngokuqinisekileyo isisombululo ekufuneka samkelwe kuso nasiphi na isicelo se-imeyile yeshishini.

    Enkosi kwakhona!
    Doug

  3. 3

    Ngelishwa, ndidibanise elo phepha kwi-RFC engeyiyo (2821 endaweni yama-2822) kodwa ilungisiwe. Izibiyeli ze-engile azinakuba yinxalenye yendawo okanye ye-domain kwindawo yedilesi ye-imeyile; Endaweni yoko bamele indawo yethokheni, okt banokusetyenziselwa ukujikeleza idilesi ye-imeyile (umzekelo kumfundi weposi) ngokuchanekileyo kuba abanakuba yinxalenye yedilesi.

    Inye into umsebenzi wam ongawenziyo kukukhathazeka malunga nefom ecatshulweyo yeedilesi ze-imeyile- apho icandelo lendawo livela kwizicatshulwa ezibini- kuba i-RFC2821 inyanzelekile ukuba ithi akukho namnye umntu oya kubhala ngale ndlela. (Ndiyakholelwa ukuba le fomu yeyokuhambelana ngasemva kwaye ngoku kukuziqhelanisa nokubi.)

  4. 4
  5. 5

    Kukho isithintelo kwi-RFC 2821 kubude bedilesi kwi-MAIL kunye ne-RCPT imiyalelo yamagama angama-256. Umda ophezulu kubude bedilesi kufuneka uqwalaselwe njengama-256.

    -Umthombo: RFC 3696 Errata

    Kwakhona, ngenxa yokuba i-RFC 2181 ithi "Igama elipheleleyo lesizinda linqunyelwe kwi-255 octet", iphindaphindwe ukutolikwa ngabantu (kubandakanya ababhali bezinye ii-RFCs) njengentsingiselo yokuba amagama e-domain anokuba ngama-255 chars ubude. Kodwa i-RFC2181 iyathetha malunga nenqanaba lokumelwa komgaqo we-DNS ocingweni, hayi abalinganiswa abanokuprintwa.

    Ubude obuphezulu begama le-domain ngama-253 chars (254 kubandakanya ichaphaza lokulandela, ii-octet ezingama-255 ocingweni ngokuphelisa ukungabinanto). Yiloo nto ke BOPHELAYO kunye ne-DiG ephumezayo.

  6. 6
  7. 7
  8. 8

Ingaba ucinga ntoni?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda indlela idatha yakho yokubhaliweyo isetyenziswe ngayo.