feat: normalize emails

This commit is contained in:
2025-12-04 11:59:30 +01:00
parent 4482c4041e
commit 610d10fd1e
12 changed files with 683 additions and 18 deletions
+32
View File
@@ -0,0 +1,32 @@
use clap::Parser;
use rs_pop_imap_importer::{config::Settings, imap_client::ImapClient};
/// List all email UIDs in IMAP inbox
#[derive(Parser, Debug)]
#[clap(version, about, long_about = None)]
struct Args {
/// Path to the .env file containing server configurations
#[clap(short, long, default_value = ".env")]
env_file: String,
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = Args::parse();
let settings = Settings::from_env_file(&args.env_file)?;
let mut imap_client = ImapClient::new(&settings.imap)?;
imap_client.login(&settings.imap)?;
imap_client.select_inbox()?;
println!("Fetching all messages...");
let messages = imap_client.fetch_all_messages()?;
println!("\nFound {} messages:", messages.len());
println!("UIDs:");
for (uid, _) in messages {
println!(" {}", uid);
}
imap_client.logout()?;
Ok(())
}