A special format email will trigger a verification bug.
byhnj opened this issue · comments
byhnj commented
The receiving email account having a special format (e.g. xxxx. xx. @ gmail. com) will trigger a bug prompt "Invalid local part at offset 0" when add to 'MimeMessage To'.
Jeffrey Stedfast commented
The local-part
of the email address is not allowed to end with a .
character. That's why the parser throws a ParseException (which is the correct thing to do).
That said, you can make the parser more lenient by creating your own ParserOptions and setting the AddressParserComplianceMode to RfcComplianceMode.Looser:
var options = ParserOptions.Default.Clone ();
options.AddressParserComplianceMode = RfcCompliance.Looser;
var mailbox = MailboxAddress.Parse (options, "xxxx.xx.@gmail.com");