IPv6 address as the domain portion of an email address

email, email-validation, ip, ipv6

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".

Problem

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?

Original source