Skip to content

Commit

Permalink
Enable auth login
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonbaeten committed Mar 4, 2024
1 parent d70c44d commit 8b9c976
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ cargo test send_sample_messages -- --ignored
Alternatively you can send messages using curl:

```sh
curl smtp://127.0.0.1:1025 --mail-from [email protected] --mail-rcpt [email protected] --upload-file samples/normal.email --user 'user:pass'
curl smtp://127.0.0.1:1025 --mail-from [email protected] --mail-rcpt [email protected] --upload-file samples/normal.email
# with tls
curl -k --ssl-reqd smtps://127.0.0.1:1025 --mail-from [email protected] --mail-rcpt [email protected] --upload-file samples/normal.email --user 'user:pass'
```
Expand Down
4 changes: 4 additions & 0 deletions backend/src/smtp/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,8 @@ impl mailin::Handler for MailHandler {
) -> mailin::Response {
mailin::response::AUTH_OK
}

fn auth_login(&mut self, _username: &str, _password: &str) -> mailin::Response {
mailin::response::AUTH_OK
}
}
1 change: 1 addition & 0 deletions backend/src/smtp/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl MailServer {

pub(super) fn with_authentication(mut self) -> Self {
self.session_builder.enable_auth(AuthMechanism::Plain);
self.session_builder.enable_auth(AuthMechanism::Login);

self
}
Expand Down

0 comments on commit 8b9c976

Please sign in to comment.