Skip to content

Mail and mbox adapter (fixes #89) #104

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

Merged
merged 5 commits into from
Jan 15, 2024

Conversation

FliegendeWurst
Copy link
Contributor

@FliegendeWurst FliegendeWurst commented Apr 11, 2021

The new MboxAdapter provides the mail content to other extractors (this resolves #89).

@FliegendeWurst FliegendeWurst force-pushed the mail-adapter branch 2 times, most recently from 81f636a to e9c5cd4 Compare April 11, 2021 16:59
@phiresky
Copy link
Owner

Hey. I'm a bit late here but if you would rebase this I would be happy to merge it. Maybe not too easy because adapters are async now..

@FliegendeWurst
Copy link
Contributor Author

Hi, thanks for the response. I'm actually working on an mbox adapter too, which I will include in this PR once it's ready.

@phiresky
Copy link
Owner

phiresky commented May 25, 2023

uh good luck with that. i tried writing an mbox parser in Rust a few years ago but apparently the mbox format has different incompatible versions that differ in how the "from " line is escaped and I couldn't even find docs about how the mbox format that Firefox uses works

@FliegendeWurst FliegendeWurst changed the title Mail adapter (fixes #89) Mail and mbox adapter (fixes #89) Jul 31, 2023
@FliegendeWurst
Copy link
Contributor Author

uh good luck with that. i tried writing an mbox parser in Rust a few years ago but apparently the mbox format has different incompatible versions that differ in how the "from " line is escaped and I couldn't even find docs about how the mbox format that Firefox uses works

Oh just splitting on "\nFrom " seems to work for mbox files saved by Thunderbird. I think most mbox variantions forbid "\nFrom " in mail content.


let mut content = Vec::new();
let s = stream! {
inp.read_to_end(&mut content).await?;
Copy link
Owner

Choose a reason for hiding this comment

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

reading the whole file into RAM is not good because it may be many gigabytes in size (e.g. firefox mailbox files?)

@phiresky phiresky merged commit af81f22 into phiresky:master Jan 15, 2024
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.

Idea: mailbox & maildir adapter
2 participants