Skip to content

MimeKit.ParseException: Invalid local-part at offset 0 on Gmail Imap #494

Description

@mbalsam

This just started getting an exception being thrown from inside of Imap.ImapFolder.Fetch() with my gmail account. See below.

I understand that local-part refers to the part to the left of the @ in the email address. With the Imap diagnostic turned on, i found a French language messages a few messages before the location with the stack trace. It that has this in the local-part:

From: =?UTF-8?Q?Lib=C3=A9ration?= <newsletter@liberation.cccampaigns.net>

The gmail "show original" shows it as

From: "Libération" <newsletter@liberation.cccampaigns.net>

Disclaimer: I'm guessing that this is the messages that's causing the crash. I cant be sure since the parse and download streams appear to be on different threads.

This is the full stack trace:

MimeKit.ParseException: Invalid local-part at offset 0
   at MimeKit.InternetAddress.TryParseLocalPart(Byte[] text, Int32& index, Int32 endIndex, Boolean throwOnError, String& localpart)
   at MimeKit.InternetAddress.TryParseAddrspec(Byte[] text, Int32& index, Int32 endIndex, Byte[] sentinels, Boolean throwOnError, String& addrspec, Int32& at)
   at MimeKit.MailboxAddress.set_Address(String value)
   at MimeKit.MailboxAddress..ctor(Encoding encoding, String name, String address)
   at MailKit.Net.Imap.ImapUtils.EnvelopeAddress.ToMailboxAddress()
   at MailKit.Net.Imap.ImapUtils.ParseEnvelopeAddressList(InternetAddressList list, ImapEngine engine, String format, CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapUtils.ParseEnvelope(ImapEngine engine, CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapFolder.FetchSummaryItems(ImapEngine engine, ImapCommand ic, Int32 index)
   at MailKit.Net.Imap.ImapEngine.ProcessUntaggedResponse(CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapCommand.Step()
   at MailKit.Net.Imap.ImapEngine.Iterate()
   at MailKit.Net.Imap.ImapEngine.Wait(ImapCommand ic)
   at MailKit.Net.Imap.ImapFolder.Fetch(IList`1 uids, MessageSummaryItems items, HashSet`1 fields, CancellationToken cancellationToken)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompatibilityCompatibility with existing softwareserver-bugThe bug appears to be in the server

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions