Hi guys, I'm setting up LLDAP via docker. Howev...
# troubleshooting
j
Hi guys, I'm setting up LLDAP via docker. However, I can't get the email to work. I added all the options to my .env file, and added verbose logging like this:
Copy code
LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET=true

LLDAP_SMTP_OPTIONS__SERVER=smtp.mailgun.org
LLDAP_SMTP_OPTIONS__USER=postmaster@mailgun.my-domain.tld

LLDAP_SMTP_OPTIONS__PASSWORD=mypasswordredacted
LLDAP_SMTP_OPTIONS__PORT=587
LLDAP_SMTP_OPTIONS__ENCRYPTION=TLS
LLDAP_SMTP_OPTIONS__FROM="LDAP <postmaster@mailgun.my-domain.tld>"

LLDAP_VERBOSE=true
However, I don't see the email process going in the log:
Copy code
lldap-lldap-1  | 2023-05-24T10:44:40.757214233+00:00  INFO     HTTP request [ 70.0µs | 100.00% ]
lldap-lldap-1  | 2023-05-24T10:44:40.757218771+00:00  INFO     ┝━ i [info]:  | uri: /reset-password/step1
lldap-lldap-1  | 2023-05-24T10:44:40.757286167+00:00  INFO     ┕━ i [info]:  | status_code: 304
Any tips/ ideas?
n
Here's a brand new thread for you! Please keep the discussion for this problem in this thread.
j
does anybody have an idea?
When retrying, I get an error in the web interface when sending the email:
Copy code
Could not initiate password reset[500 ]: Internal server error: `Could not send email: Connection error: Connection error: received corrupt message`
I am using mailgun, with the following (redacted) settings (from the startup logs, verbose) via env vars:
Copy code
smtp_options: MailOptions {
03/06/2023 8:38:51
        enable_password_reset: true,
03/06/2023 8:38:51
        from: Some(
03/06/2023 8:38:51
            Mailbox {
03/06/2023 8:38:51
                name: Some(
03/06/2023 8:38:51
                    "LDAP",
03/06/2023 8:38:51
                ),
03/06/2023 8:38:51
                email: Address {
03/06/2023 8:38:51
                    serialized: "postmaster@mailgun.mydomain.tld",
03/06/2023 8:38:51
                    at_start: 10,
03/06/2023 8:38:51
                },
03/06/2023 8:38:51
            },
03/06/2023 8:38:51
        ),
03/06/2023 8:38:51
        reply_to: None,
03/06/2023 8:38:51
        server: "smtp.mailgun.org",
03/06/2023 8:38:51
        port: 587,
03/06/2023 8:38:51
        user: "postmaster@mailgun.mydomain.tld",
03/06/2023 8:38:51
        password: ***SECRET***,
03/06/2023 8:38:51
        smtp_encryption: Tls,
03/06/2023 8:38:51
        tls_required: None,
03/06/2023 8:38:51
    },
03/06/2023 8:38:51
s
hey @janwiebe did you ever get this resolved? i'm trying to set up SMTP and can't get it to work either
Copy code
00.600866446+00:00  INFO     ┝━ i [debug]: Sending email to 'mail@sld.de' as 'Name Postmaster <postmaster@sld.de.com>' via 'postmaster@sld.de'@'ssl0.ovh.net':'465'
00.674473395+00:00  DEBUG    │  ┝━ :bug: [debug]: No cached session for DnsName(DnsName(DnsName("ssl0.ovh.net"))) | log.target: "rustls::client::hs" | log.module_path: "rustls::client::hs" | log.file: "/build/cargo-vendor-dir/rustls-0.20.8/src/client/hs.rs" | log.line: 55
00.674551083+00:00  DEBUG    │  ┝━ :bug: [debug]: Not resuming any session | log.target: "rustls::client::hs" | log.module_path: "rustls::client::hs" | log.file: "/build/cargo-vendor-dir/rustls-0.20.8/src/client/hs.rs" | log.line: 127
02.801816418+00:00  ERROR    │  ┝━ :rotating_light: [error]: TLS alert received: AlertMessagePayload {
    level: Fatal,
    description: ProtocolVersion,
} | log.target: "rustls::conn" | log.module_path: "rustls::conn" | log.file: "/build/cargo-vendor-dir/rustls-0.20.8/src/conn.rs" | log.line: 1327
02.802112513+00:00  WARN     │  ┝━ :construction: [warn]: Error sending email: lettre::transport::smtp::Error {
    kind: Connection,
    source: lettre::transport::smtp::Error {
        kind: Connection,
        source: Custom {
            kind: InvalidData,
            error: AlertReceived(
                ProtocolVersion,
            ),
        },
    },
}
interesting, when i set a wrong password i get exactly the same error message
j
Yes, i got it working, with these settings:
Copy code
LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET=true

LLDAP_SMTP_OPTIONS__SERVER=smtp.mailgun.org
LLDAP_SMTP_OPTIONS__USER=postmaster@mydomain.com

LLDAP_SMTP_OPTIONS__PASSWORD=[mypassword]
LLDAP_SMTP_OPTIONS__PORT=587
LLDAP_SMTP_OPTIONS__ENCRYPTION=START-TLS

LLDAP_SMTP_OPTIONS__FROM="noreply@mydomain.com"
s
thanks, so switching from TLS to START-TLS
i'm sure my provider wants, or at least does support, TLS
switching to STARTTLS gives me a differnt error. this is from the webui: > Could not initiate password reset[500 Internal Server Error]: Internal server error:
Could not send email: response error: incomplete response
i tried switching to my personal gmail account and managed to get it working. i did not get it working with the smtp server at OVH. @nitnelave what do you think about this? it seems there are compatibility issues with certain smtp servers so it's a hit or miss whether lldap will be able to work with any of them
n
Hey @steveej ! Have you tried all the various combinations of port and encoding (TLS, starttls)? It should be pretty much compatible with everything, but in case it isn't, you can ask the folks over at the "lettre" rust library, that's what I'm using to send emails. They would be better able to debug. Make sure you enable debug mode in LLDAP, that'll give you logs of how we try to send the email
2 Views