trailing dot in local part of email
email, email-address, regex
Solution
EDIT: My old answer was wrong.
I see absolutely no safety implications in this rule, but RfC 5322 explicitly only allows dots inside the local part of the mail address, not at the beginning and end. That being said, I would not be surprised if in practice, it would still just work with a lot of mail servers. So, while `.@example.com` is not a valid address according to RfC 5322, for practical purposes, it could be a working address, only the mail server for `example.com` can know.
As I said, the relevant spec is RfC 5322, taking into account that RfC 5321 adds the restriction that the local part not have more than 64 characters. And, yes, the standard allows for a lot of addresses that will simply not work for very many web sites or mail programs, such as `"this is v@lid!"@example.com`. It is unwise to use this kind of addresses, but that is because of software bugs that lead to them not being accepted.
Problem
In our online shop, we ran into a problem wherein a certain user can't purchase because of an "invalid email address". It looks like this: `her.email.address.@docomo.ne.jp` I think what's setting off the invalid email error is the trailing dot in the local part of the email. In the code, I commented out the second condition: `if (isc_substr($local, 0, 1) == '.' || isc_substr($local, -1, 1) == '.')` to make it work. Is this safe? Or should we advise the customer to change her email address?