Is root @ [127.1] the syntactically correct email address?

Is a root@[127.1]syntactically valid email address?

Why? Why not?

+5
source share
5 answers

It depends on whether you have values ​​in the header (RFC 5322) or in the addresses of the envelope (RFC 5321), and in the latter case, whether you include <> everything between <> (that is, the source route) or just the mailbox.

RFC 5322, RFC 5322 , ! ! ! !. Perl: Mail:: RFC822:: Address.

RFC 5321 4.1.3, 1.2.3.4 "standard-tag:" (, [IPv6:::1]). , " ", < > .

, , SMTP- . (, , , SMTP.)

( , RFC 5336 a.k.a. "UTF8SMTP". , .)

+6

RFC 5322, 3.4.1.

    (RFC) 2822,     (RFC) 822, " ARPA    " ", ,     , RFC.

, http://isemail.info/, :

: RFC 5322. .

: RFC 5321

RFC- :

domain-literal = [CFWS] "[" * ([FWS] dtext) [FWS] "]" [CFWS]

(RFC 5322, 3.4.1)

+16

, RFC2822 IP- , IP-.

root@[127.0.0.1].

+3

RFC-822, , , , . :

 addr-spec   =  local-part "@" domain        ; global address    

 domain      =  sub-domain *("." sub-domain)

 sub-domain  =  domain-ref / domain-literal

 domain-literal =  "[" *(dtext / quoted-pair) "]"

 dtext       =  <any CHAR excluding "[",     ; => may be folded
                 "]", "\" & CR, & including
                 linear-white-space>
+2

,

, , ( @) ( @). - :., '- ' _, .

IP-, .

Since your example does not meet the requirements for a valid host name (foo.bar), and it does not contain a valid IP address surrounded by square brackets, it is not a valid email address.

Check the following email verification code (minus the IP address verification bit) that will verify the email address . This can be easily modified to work with domain names of ip addresses.

-3
source

All Articles