Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse Authentication Results where smtp.mailfrom contains an "=" #590

Closed
The-Nutty opened this issue Jul 15, 2020 · 3 comments
Closed
Labels
compatibility Compatibility with existing software

Comments

@The-Nutty
Copy link

Describe the bug
AuthenticationResults.Parse Throws an error when the smtp.mailfrom address contains an "="

Platform (please complete the following information):

  • OS: Windows
  • .NET Framework: Net core 3.1
  • MimeKit Version: 2.9.1

To Reproduce
Run the follwing code var ar = AuthenticationResults.Parse(Encoding.ASCII.GetBytes(@"i=1; relay.mailrelay.com; dkim=pass header.d=domaina.com header.s=sfdc header.b=abcefg; dmarc=pass (policy=quarantine) header.from=domaina.com; spf=pass (relay.mailrelay.com: domain of [email protected]_sender.com designates 1.1.1.1 as permitted sender) smtp.mailfrom=support=domaina.com__0-1q6woix34obtbu@823lwd90ky2ahf.mail_sender.com"));

Currently it throws with the following Exception:

MimeKit.ParseException: Invalid propspec token at offset 315
   at MimeKit.Cryptography.AuthenticationResults.TryParseMethods(Byte[] text, Int32& index, Int32 endIndex, Boolean throwOnError, AuthenticationResults authres)
   at MimeKit.Cryptography.AuthenticationResults.TryParse(Byte[] text, Int32& index, Int32 endIndex, Boolean throwOnError, AuthenticationResults& authres)
   at MimeKit.Cryptography.AuthenticationResults.Parse(Byte[] buffer)
   at Testing.Program.Main(String[] args) in D:\other code\C#\Testing\Testing\Program.cs:line 388
   at Testing.Program.<Main>(String[] args)

Expected behavior
I would expect the string to parse correctly.

@jstedfast
Copy link
Owner

= is a tspecial character which is technically not allowed :-\

@jstedfast jstedfast added the compatibility Compatibility with existing software label Jul 15, 2020
@The-Nutty
Copy link
Author

Yeah i did think it was very odd, thanks for the quick response.

@jstedfast
Copy link
Owner

No problem. Let me know if my work-around doesn't work for you. I made the code a lot more liberal in what it accepts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with existing software
Projects
None yet
Development

No branches or pull requests

2 participants