hello Arnaud

a minimal email DNS checker could be as simple as

read join dns:// next find email "@"


but if you really want a maximal validating parser per RCF821 ...
you can make some rules,  these were derived from
http://www.freesoft.org/CIE/RFC/821/15.htm



a: charset [#"A" - #"Z" #"a" - #"z"]
d: charset {0123456789}
special: charset [ #"^(00)" - #"^(1F)" #"^(7F)"
    #"<" #">" #"(" #")" #"[" #"]" #"\" #"." #"," #";" #":" #"@" #"^""
]
snum: [["25" ["0" | "1" | "3" | "4" | "5"]] |
      ["2" ["0" | "1" | "3" | "4"]d] |["1" 2 d] | [1 2 d]
]
qc: complement charset [#"^(10)" #"^(13)" #"^"" #"\"]
c:  complement union special charset " "
x:  ["\" skip]


dotnum:  [snum "." snum "." snum "." snum]
number:  [some d]
let-dig: union a d
ldh-str: [some [let-dig | "-"]]
name:    [a ldh-str]
element: [["#" number] | ["[" dotnum "]"] | name]
domain:  [element any ["." element]]
qtext:   [some [qc |x ]]
char:    [c | x]
string:  [some char]
quoted-string: ["^"" qtext "^""]
dot-string: [[string "." dot-string] | string]
local-part: [dot-string | quoted-string]

mailbox: [local-part "@" copy dmn domain (dns: read join dns:// dmn)]

; to use these rules ...

email: [EMAIL PROTECTED]
dns: none

parse/all email mailbox
dns


HTH


On Sat, 31 Jan 2004 [EMAIL PROTECTED] wrote:

>
>
> Hi all,
>
> In order to improve an email syntax checking function, i am searching a command to 
> do the same thing as
>
> checkdnsrr("rebol.com", "MX") in PHP
>
> who perform a search in DNS record (return true if found a record).
>
> I presume i could replace a regular expression like 
> "^[_\.0-9a-z-]+@([0-9a-z-]+\.)+[a-z]{2,4}$" with his equivalent in a big parse or 
> something like that ;-)
>
> Any suggestions welcome (i'd like to replace some old PHP scripts by a small Rebol 
> script ;-)
>
> AMIGAlly,
>
> Arnaud aka bigdan
> East of France, Europe
> --
> Arnaud Danassie <rebol "at" migazone "dot" com>
> Amiga and Pegasos user (http://www.pegasosppc.com fo details)
>
> --
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
>
-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to