mailrs-shield 4.0.0

SMTP anti-spam primitives: DNS blocklist (DNSBL) queries, greylisting policy with optional in-process kevy store, and PTR / forward-confirmed reverse DNS (FCrDNS) checks.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Where a greylist triplet's first-seen time is stored. The receiver's
//! greylist stage writes it and the server's Postgres backfill warms it,
//! so both use this one spelling.

/// The kevy key for one triplet (see [`crate::greylist::triplet_key`]).
pub fn store_key(triplet: &str) -> String {
    format!("gl:{triplet}")
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn the_greylist_key_keeps_its_prod_spelling() {
        assert_eq!(store_key("1.2.3.4|s@x|r@y"), "gl:1.2.3.4|s@x|r@y");
    }
}