Question

I'm trying to test a new email validation function I've written, based on this one., but with some minor adjustments.

From a large set of valid and invalid entries, the function finds just one false negative - an address which has an IPv6 address instead of a domain.

user@[IPv6:2001:db8:1ff::a0b:dbd0]

The source is this wikipedia page: Email Addresses

However, System.Net.IPAddress fails to parse IPv6:2001:db8:1ff::a0b:dbd0, and I can't find any references in the RFC4291 to any prefix of IPv6.

Obviously, IPv6:2001:db8:1ff::a0b:dbd0 is not a valid IPv6 address, but is it valid in an email address? Or is wikipedia wrong?

Should the actual email be user@[2001:db8:1ff::a0b:dbd0] Anyone know?

Was it helpful?

Solution

You are right to look at RFC4291 for the IPv6 address format. However, for SMTP (and thus for any other email software handling addresses) you should also look at Address Literals in RFC5321.

The one you want is probably "IPv6-address-literal".

OTHER TIPS

For those still looking for this, the IPv6: prefix tag is required.

https://www.rfc-editor.org/rfc/rfc5321#section-4.1.3

For IPv6 and other forms of addressing that might eventually be standardized, the form consists of a standardized "tag" that identifies the address syntax, a colon, and the address itself ...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top