mirror of https://github.com/terhechte/postsack
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
568 B
Rust
24 lines
568 B
Rust
mod filesystem;
|
|
mod mail;
|
|
|
|
use shellexpand;
|
|
use std::{path::PathBuf, str::FromStr};
|
|
|
|
use super::{Config, ImporterFormat, MessageSender, Result};
|
|
|
|
#[derive(Default)]
|
|
pub struct AppleMail {}
|
|
|
|
impl ImporterFormat for AppleMail {
|
|
type Item = mail::Mail;
|
|
|
|
fn default_path() -> Option<PathBuf> {
|
|
let path = shellexpand::tilde("~/Library/Mail");
|
|
Some(PathBuf::from_str(&path.to_string()).unwrap())
|
|
}
|
|
|
|
fn emails(&self, config: &Config, sender: MessageSender) -> Result<Vec<Self::Item>> {
|
|
filesystem::read_emails(config, sender)
|
|
}
|
|
}
|