rust implementation of the purelymail rest api, and a close to full cli implementation aswell
- Rust 100%
| purelymail-api | ||
| purelymail-cli | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| openapi.json | ||
| README.md | ||
A fully functioning rust implementation of the purelymail api, and a nearly-complete cli for said api.
API example:
fn main() {
let args: Vec<String> = env::args().collect();
let client = purelymail_api::Client::new(args[1]);
let domains = client.list_domains(
ListDomainsRequest {
include_shared: false
}
);
let domains = match domains {
Ok(v) => v,
Err(e) => eprintln!("failed to get domains: {e}"),
};
println!("{domains:#?}");
}
When executed with your purelymail api token as the first argument will output something like this:
ListDomainsResponse {
domains: [
DomainInfo {
name: "bossi.ng",
allow_account_reset: true,
symbolic_subaddressing: false,
is_shared: false,
dns_summary: DnsSummary {
passes_mx: true,
passes_spf: true,
passes_dkim: false,
passes_dmarc: false,
},
},
DomainInfo {
name: "bossing.vip",
allow_account_reset: true,
symbolic_subaddressing: true,
is_shared: false,
dns_summary: DnsSummary {
passes_mx: true,
passes_spf: true,
passes_dkim: true,
passes_dmarc: true,
},
},
]
}
cli example:
purelymail-cli --token <TOKEN> domain list:
+------------------+---------------+---------------------+----------+
| domain | account reset | symb. subaddressing | dns |
+===================================================================+
| bossi.ng | enabled | enabled | MX ✔️ |
| | | | SPF ✔️ |
| | | | DKIM ✔️ |
| | | | DMARC ✔️ |
|------------------+---------------+---------------------+----------|
| bossing.vip | enabled | enabled | MX ✔️ |
| | | | SPF ✔️ |
| | | | DKIM ✔️ |
| | | | DMARC ✔️ |
+------------------+---------------+---------------------+----------|
check out the help pages for the cli to learn more about it. it isn't done tho.
License
AGPL v3, refer to the license file.