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

Use new mailparse API to parse Message-IDs #1306

Merged
merged 2 commits into from
Feb 22, 2020
Merged

Use new mailparse API to parse Message-IDs #1306

merged 2 commits into from
Feb 22, 2020

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Feb 21, 2020

Message-IDs are not addresses, and should be parsed differently.

@link2xt link2xt force-pushed the mailparse-msgids branch 3 times, most recently from c81337a to ecda36f Compare February 21, 2020 23:57
if ids.len() == 1 {
let id = &ids[0];
if id.starts_with('<') && id.ends_with('>') {
Ok(id.chars().skip(1).take(id.len() - 2).collect())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks a bit complicated -- i take it that something like id[1..id.len()-1].clone() or so does not work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indexing operates on byte level, it is unsafe.

Copy link
Contributor

@hpk42 hpk42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

2 participants