jstedfast / MimeKit

A .NET MIME creation and parser library with support for S/MIME, PGP, DKIM, TNEF and Unix mbox spools.

Home Page:http://www.mimekit.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A special format email will trigger a verification bug.

byhnj opened this issue · comments

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

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");