Sign inSign up

ectobit/budgie

By ectobit

•Updated almost 4 years ago

Image
0

5.3K

ectobit/budgie repository overview

⁠budgie

pipeline License

Micro service in Rust to send e-mail using SMTP relay.

⁠Test service

curl -v localhost:3000/send -d \
    '{ "from": "[email protected]", "to": "[email protected]", "subject": "Hello", "plain": "Some message" }'

⁠Custom message-id

use gethostname::gethostname;
use rand::Rng;
use std::process;
use std::time::SystemTime;

fn message_id(&self) -> anyhow::Result<String> {
    let t = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?;

    let mut rng = rand::thread_rng();
    let r: u32 = rng.gen();

    Ok(format!(
        "<{}.{}.{}@{}>",
        t.as_nanos(),
        process::id(),
        r,
        gethostname().into_string().unwrap()
    ))
}

Tag summary

Content type

Image

Digest

sha256:88ad6ba98…

Size

2.1 MB

Last updated

almost 4 years ago

docker pull ectobit/budgie:buildcache