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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Email through Starttls not working #890

Open
zaggash opened this issue Apr 2, 2024 · 2 comments
Open

[BUG] Email through Starttls not working #890

zaggash opened this issue Apr 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@zaggash
Copy link

zaggash commented Apr 2, 2024

Describe the bug
Using the CLI to test the smtp and working on port 587 STARTTL is not working when it is wokring fine with others applications.

It throws me the following error:

2024-04-02T16:55:34.298682303+00:00  ERROR    馃毃 [error]: TLS alert received: AlertMessagePayload {
    level: Fatal,
    description: ProtocolVersion,
} | log.target: "rustls::conn" | log.module_path: "rustls::conn" | log.file: "/__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.20.8/src/conn.rs" | log.line: 1327
Error: Could not send email: {:#}

Caused by:
    0: Connection error: Connection error: received fatal alert: ProtocolVersion
    1: Connection error: received fatal alert: ProtocolVersion
    2: received fatal alert: ProtocolVersion
smtp_options: MailOptions {
        enable_password_reset: true,
        from: Some(
            Mailbox {
                name: None,
                email: Address {
                    serialized: "ldap@mydomain.tld",
                    at_start: 4,
                },
            },
        ),
        reply_to: Some(
            Mailbox {
                name: None,
                email: Address {
                    serialized: "noreply@mydomain.tld",
                    at_start: 7,
                },
            },
        ),
        server: "smtp.server.tld",
        port: 587,
        user: "userlogin@domain.tld",
        password: ***SECRET***,
        smtp_encryption: StartTls,
        tls_required: None,

To Reproduce
Steps to reproduce the behavior:

  1. docker exec in the lldap container
  2. Setup your credentials and smtp settings for /app/lldap send_test_email
  3. Set the --smtp-encryption to STARTTLS
  4. See error

Expected behavior
The email should be sent.

However, if I use TLS on port 465 it is working fine.

@zaggash zaggash added the bug Something isn't working label Apr 2, 2024
@nitnelave
Copy link
Member

That sounds more like an issue with lettre, the email library we're using. Although out of curiosity, why use starttls when TLS works? It's simply superior.

@zaggash
Copy link
Author

zaggash commented Apr 2, 2024

I didn't know how SMTP encryption worked.
I figured I better use TLS after a bit of research.
However, I wanted to report for others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants