mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-15 11:27:53 +08:00
28 lines
712 B
Rust
28 lines
712 B
Rust
#![cfg(feature = "jmap")]
|
|
|
|
#[path = "common/jmap.rs"]
|
|
mod jmap;
|
|
|
|
use std::{env, io::Write};
|
|
|
|
use tempfile::NamedTempFile;
|
|
|
|
#[test]
|
|
#[ignore = "requires FASTMAIL_{EMAIL,API_TOKEN} env vars and --ignored"]
|
|
fn fastmail_jmap() {
|
|
let email = env::var("FASTMAIL_EMAIL").expect("FASTMAIL_EMAIL env var");
|
|
let token = env::var("FASTMAIL_API_TOKEN").expect("FASTMAIL_API_TOKEN env var");
|
|
|
|
let mut config = NamedTempFile::new().unwrap();
|
|
let config_tpl = format!(
|
|
r#"[accounts.fastmail]
|
|
default = true
|
|
jmap.server = "https://api.fastmail.com/jmap/session"
|
|
jmap.auth.bearer.token.raw = "{token}""#
|
|
);
|
|
|
|
config.write(&config_tpl.into_bytes()).unwrap();
|
|
|
|
jmap::run(config.path(), email);
|
|
}
|