diff --git a/README.md b/README.md index 2c2bfbc..db0a438 100644 --- a/README.md +++ b/README.md @@ -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 myself@example.com --mail-rcpt receiver@example.com --upload-file samples/normal.email --user 'user:pass' +curl smtp://127.0.0.1:1025 --mail-from myself@example.com --mail-rcpt receiver@example.com --upload-file samples/normal.email # with tls curl -k --ssl-reqd smtps://127.0.0.1:1025 --mail-from myself@example.com --mail-rcpt receiver@example.com --upload-file samples/normal.email --user 'user:pass' ``` diff --git a/backend/src/smtp/handler.rs b/backend/src/smtp/handler.rs index 3d8f63e..7fc3aa4 100644 --- a/backend/src/smtp/handler.rs +++ b/backend/src/smtp/handler.rs @@ -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 + } } diff --git a/backend/src/smtp/server.rs b/backend/src/smtp/server.rs index 328bc78..a5bc629 100644 --- a/backend/src/smtp/server.rs +++ b/backend/src/smtp/server.rs @@ -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 }