Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable auth login #118

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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