-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Retrieving headers in message order #19
Comments
Do you need to have ordered access to all headers relative to each other or just one header type? Because if you are interested in the order of just one header type such as Received, you can call |
I would like them to be relative to each other for all headers, not just some headers or a particular one. This is to allow me to use this re-mail email after body modification (encryption/filtering/URL mangling) in a MTA filter. I am hoping to use this library along with For example:
The ordering matters here because it allows me to figure out approximately where a particular header was added. For example the DKIM-Signature was added before it was received by I'm working on a project where I am re-mailing the original message after verification/validation (and additional headers), and I want the recipient to have full access to all headers in the original order so they can trace where particular headers were added. |
I'll see how I can add that. Would an iterator returning the ordered headers work for your use case? Each item would be a tuple of |
That would be fantastic! |
@bertjwregeer I just added a Could you give it a quick test? If everything works well I'll publish a new version to crates.io. Edit: I'll also add a function to get a string from a HeaderOffset. |
Reading the code, it looks to be what I want, I don't mind getting the offsets, I can just turn that into a string myself, but a utility function for it would be great! Are there any tests to make sure this doesn't regress in the future? I didn't see those in the commits that were added. I haven't had time to pull in this repo and test locally, hoping to have time later tonight for that. Now I need to figure out how to get them into |
@bertjwregeer Version 0.4.7 has been published to crates.io with support for accessing raw headers in order. Instead of returning the offsets, the |
I am attempting to use this library to create a new message, but I want to keep all the existing headers in the same order they were present in the original message so that things like Received headers don't move around compared to the rest of the headers.
Is this a use case that was considered for this library?
I am not sure the best way to build it since right now it means iterating over all of the RawHeaders and sorting them by their offsets.
The text was updated successfully, but these errors were encountered: