Function spamassassin_milter::run

source ·
pub async fn run(
    listener: impl Listener,
    config: Config,
    shutdown: impl Future
) -> Result<()>
Expand description

Starts SpamAssassin Milter listening on the given socket using the supplied configuration.

§Errors

If execution of the milter fails, an error is returned.

§Examples

use std::process;
use tokio::{net::TcpListener, signal};

let listener = TcpListener::bind("127.0.0.1:3000").await?;
let config = Default::default();
let shutdown = signal::ctrl_c();

if let Err(e) = spamassassin_milter::run(listener, config, shutdown).await {
    eprintln!("failed to run spamassassin-milter: {e}");
    process::exit(1);
}