Is it a valid email if the email has a dash (-) at the end of local part of an email? [...] Google says it is invalid, so for the time being I assume it as invalid too, though RFC excludes only [dot] character from starting with and/or ending local part.
It's valid. You're only seeing it rejected by Google because it performs a completely different check – they have their own policies on what the local-part can be, as do many other providers.
Google, or anyone else, would be obligated to accept all possibly valid email addresses only if the form was actually asking for an existing, valid email address (possibly from provider). For example, it would be an error if Gmail's To:/Cc: field rejected a valid address.
But the field you highlighted doesn't ask you for an existing email address; it asks for an account name on Google systems, which will be the basis for an email address only once the account has been created. There is nothing that would forbid Google, or anyone else, from limiting the set of valid account names (or, really, even mailbox names) on their own system.
Or, in other words, defining the allowed characters for 'local-part' only means that mail applications SMTP servers must accept such addresses in RFC 822 headers and SMTP commands – but it doesn't say anything about being able to create such mailboxes. (Indeed, back when the early email RFCs were written and most mailboxes were still tied to OS-level accounts, their names had similar or even stricter limits.)
For example, this part of RFC 5321 (section 4.1.2, below ABNFs) explicitly says that a receiving host is allowed to and indeed should have much stricter limits on how its own mailboxes are named:
While the above definition for Local-part is relatively permissive,
for maximum interoperability, a host that expects to receive mail
SHOULD avoid defining mailboxes where the Local-part requires (or
uses) the Quoted-string form or where the Local-part is case-sensitive.
So, although anunusualemail-@gmail.com
is valid syntactically, that alone doesn't mean that Google must allow you to create it.
Good question. Have you looked at this Stack Overflow question and answer thread? Lots of info—much of it out of date at this point—but still good starting point/
– JakeGould – 2018-06-18T14:56:31.783good reference link, it seems google treat that email as invalid, while Microsoft don't have any problem. – Jimson Kannanthara James – 2018-06-18T15:00:16.427
1Sharing this since you brought up Google: Gmail ignores any periods in an email address, so if your email was "anunusualemail@gmail.com", you would also receive mail sent to "an.unusual.email@gmail.com". It also ignores pluses at the end of the email address: "anunusualemail+something@gmail.com". – mowwwalker – 2018-06-19T19:12:45.147
1On my own mail service I can ban the letter "u" from usernames. Just because. – Agent_L – 2018-06-20T08:49:50.830