use mailcore::dns::discover_mail_server;

#[tokio::main]
async fn main() {
    let email = std::env::args().nth(1).expect("Usage: test_dns <email>");

    println!("Discovering server for: {}", email);

    match discover_mail_server(&email).await {
        Ok(config) => {
            println!("✓ IMAP: {}:{}", config.imap_host, config.imap_port);
            println!("✓ SMTP: {}:{}", config.smtp_host, config.smtp_port);
        }
        Err(e) => {
            eprintln!("✗ Error: {}", e);
        }
    }
}
