有效的电子邮件地址的最大长度是多少? [英] What is the maximum length of a valid email address?

查看:305
本文介绍了有效的电子邮件地址的最大长度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有效的电子邮件地址的最大长度是多少?是否由任何标准定义?

What is the maximum length of a valid email address? Is it defined by any standard?

推荐答案

[UPDATED] 254 的正确答案现已被IETF接受我在提交此处的勘误后。

[UPDATED] The correct answer of 254 has now been accepted by the IETF following the erratum I submitted here.

您可以对任何给定的地址进行全面诊断 here

You can get a full diagnosis of any given address here.

RFC 3696的原始版本确实说320是最大长度,但是约翰·克林森后来接受了这个错误。

The original version of RFC 3696 did indeed say 320 was the maximum length, but John Klensin subsequently accepted this was WRONG.

最大长度在 RFC 5321 中指定:反向路径或前向路径的最大总长度为256个字符

The maximum length is specified in RFC 5321: "The maximum total length of a reverse-path or forward-path is 256 characters"

RFC 3696已更正这里

RFC 3696 was corrected here

我注意到John Klensin可能会致电的记录在修正中同样错误:路径被定义为

I note for the record that John Klensin may actually be wrong in his correction: a Path is defined as

Path = "<" [ A-d-l ":" ] Mailbox ">"



邮箱必须不超过254个字符,以将路径保持在256以下。

So the Mailbox element (i.e. the email address) has angle brackets around it to form a Path, so the Mailbox must be no more than 254 characters to keep the path under 256.

我现在已经将Cal Henderson,Dave Child,Phil Haack,Doug Lovell和RFC 3696. 158所有测试地址。

I've now collated test cases from Cal Henderson, Dave Child, Phil Haack, Doug Lovell and RFC 3696. 158 test addresses in all.

我对所有验证器运行了所有这些测试。比较如下: http://www.dominicsayers.com/isemail

I ran all these tests against all the validators I could find. The comparison is here: http://www.dominicsayers.com/isemail

我会尝试让这个页面保持最新,因为人们增强了他们的验证器。感谢Cal,Dave和Phil在编写这些测试和对我自己的验证器的建设性批评方面的帮助和合作。

I'll try to keep this page up-to-date as people enhance their validators. Thanks to Cal, Dave and Phil for their help and co-operation in compiling these tests and constructive criticism of my own validator.

人们应该意识到针对RFC 3696的勘误。其中三个典型的例子实际上是无效的地址。

People should be aware of the errata against RFC 3696 in particular. Three of the canonical examples are in fact invalid addresses.

这篇关于有效的电子邮件地址的最大长度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆