Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudflare/dmarc
https://github.com/cloudflare/dmarc
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/cloudflare/dmarc
- Owner: cloudflare
- License: mit
- Created: 2022-01-18T15:25:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-21T12:49:54.000Z (about 1 year ago)
- Last Synced: 2024-04-14T22:17:05.670Z (7 months ago)
- Language: Rust
- Size: 70.3 KB
- Stars: 13
- Watchers: 8
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dmarc
> DMARC ([RFC7489]) implementation
## Features
### Load the policy for a domain
```rust
let policy: Option = dmarc::load_policy(&logger, &from_domain).await?;
```The `load_policy` arguments are the following:
- `logger`: [slog]::Logger
- `from_domain`: &str ([RFC5322].From's domain)### Apply a policy
```rust
let dkim_result: cfdkim::DKIMResult = ...;
let spf_result: SPFResult = ...;let ctx = dmarc::PolicyContext {
from_domain: &from_domain,
logger: &logger,
dkim_result,
spf_result,
};let res: DMARCResult = policy.apply(&ctx);
println!("dmarc={}", res.to_str());
````dkim_result` is the result of verifying DKIM using the [cfdkim] crate. In the future it should be a trait.
`spf_result` is the result of verifying SPF.
### Sending feedback report
Not planned yet.
[RFC7489]: https://datatracker.ietf.org/doc/html/rfc7489
[slog]: https://crates.io/crates/slog
[RFC5322]: https://datatracker.ietf.org/doc/html/rfc5322
[cfdkim]: https://crates.io/crates/cfdkim