maik 0.2.0

A mock SMTP server library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[derive(Clone)]
pub struct Mailbox {
    user: Vec<u8>,
    password: Vec<u8>,
}

impl Mailbox {
    pub fn new(user: &str, password: &str) -> Self {
        Self {
            user: user.as_bytes().to_vec(),
            password: password.as_bytes().to_vec(),
        }
    }

    pub fn authenticate(&self, user: &[u8], password: &[u8]) -> bool {
        user == self.user && password == self.password
    }
}