While reviewing the PHPmailer vuln internally, Gavin Porter (our Security Manager) noticed this:
The regex is mostly implemented in accordance with the RFC although it
doesn't support some of the weird things like spaces and quoted sections
that are theoretically possible.
However, it would allow invalid repeated strings of dots in the domain
part, such as me@test...com or me @test...
I would recommend changing the function from:
We think it's ok not to support the weird stuff - spaces, etc, but probably a good idea to make this change.