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

Add functions to parse message IDs #53

Closed
link2xt opened this issue Jan 17, 2020 · 4 comments
Closed

Add functions to parse message IDs #53

link2xt opened this issue Jan 17, 2020 · 4 comments

Comments

@link2xt
Copy link
Contributor

link2xt commented Jan 17, 2020

Parsing headers such as Reply-To is tricky because they are list of message IDs, and each msg-id may be surrounded by comments according to RFC 5322.

Since the library has address-parsing functions (#34), it would be nice to also parse message IDs.

@staktrace
Copy link
Owner

Keep in mind that the address parsing doesn't fully handle comments either. In practice they are pretty rare. I'll keep this open since it seems like a useful thing to add eventually but in almost all cases you should be fine to just split by commas to get the list of message ids.

@staktrace
Copy link
Owner

Btw, @link2xt did you actually run into real world cases where the message IDs cannot just be split by commas? Or is this more of a theoretical concern?

@link2xt
Copy link
Contributor Author

link2xt commented Feb 2, 2020

Mostly theoretical, so actually parsing all the cases specified in the standard is not necessary, but it would be nice to provide APIs for parsing even if they just split lists by spaces and wrap IDs into newtype. This way it will be possible to update all depending crates in the future if such a problem arises, for example if rust is used to parse NNTP archives.

@staktrace
Copy link
Owner

staktrace commented Feb 3, 2020 via email

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

No branches or pull requests

2 participants