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

Parsing error on timezone found in the wild #182

Closed

Conversation

giniouxe
Copy link
Contributor

@giniouxe giniouxe commented Nov 5, 2024

The timezone seem to be invalid according to RFC 2822, but I'm not totally sure, and since some other invalid datetime seem to be handled by the RFC2822 parser, I'm still submitting this case. Causes the following error:

(MatchError) no match of right hand side value: {:error, :invalid_format}
    (mail 0.4.2) lib/mail/parsers/rfc_2822.ex:153: Mail.Parsers.RFC2822.to_datetime/1
    (mail 0.4.2) lib/mail/parsers/rfc_2822.ex:463: Mail.Parsers.RFC2822.parse_received_value/1
    (mail 0.4.2) lib/mail/parsers/rfc_2822.ex:313: Mail.Parsers.RFC2822.parse_headers/3
    (mail 0.4.2) lib/mail/parsers/rfc_2822.ex:56: Mail.Parsers.RFC2822.parse/2

as reproduced in the failing test.

The timezone seem to be invalid according to RFC 2822, but I'm not
totally sure, and since some other invalid datetime seem to be
handled by the RFC2822 parser, I'm still submitting this case.
Causes the following error:
```
(MatchError) no match of right hand side value: {:error, :invalid_format}
    (mail 0.4.2) lib/mail/parsers/rfc_2822.ex:153: Mail.Parsers.RFC2822.to_datetime/1
    (mail 0.4.2) lib/mail/parsers/rfc_2822.ex:463: Mail.Parsers.RFC2822.parse_received_value/1
    (mail 0.4.2) lib/mail/parsers/rfc_2822.ex:313: Mail.Parsers.RFC2822.parse_headers/3
    (mail 0.4.2) lib/mail/parsers/rfc_2822.ex:56: Mail.Parsers.RFC2822.parse/2
```
as reproduced in the failing test.
@giniouxe giniouxe closed this Nov 15, 2024
@giniouxe giniouxe deleted the failing-test-unparsable-date branch November 15, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant