https://github.com/lldap/lldap logo
mccmax95 - I am running into the following erro...
# troubleshooting
m
I am running into the following error:
Copy code
Could not initiate password reset[500 ]: Internal server error: `Could not send email: Error sending email: permanent error (535): 5.7.8 Username and Password not accepted. For more information, go to5.7.8 https://support.google.com/mail/?p=BadCredentials 6a1803df08f44-6fd772fa9c9sm11203576d6.82 - gsmtp`
though I ran this through a smtp tester and it worked with the same setup. I do have my server using the SMTP email with a different application though I don't think that would matter. This is what I have atm :
Copy code
LDAP_SMTP_OPTIONS__FROM: LLDAP Admin <${SMTP_USER}>
LLDAP_SMTP_OPTIONS__PASSWORD: ${SMTP_PASSWORD}
LLDAP_SMTP_OPTIONS__PORT: 587
LLDAP_SMTP_OPTIONS__REPLY_TO: Do not reply <${SMTP_USER}>
LLDAP_SMTP_OPTIONS__SERVER: smtp.gmail.com
LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION: STARTTLS
LLDAP_SMTP_OPTIONS__USER: ${SMTP_USER}
LLDAP_VERBOSE: true
a
message has been deleted
n
I see you have verbose mode already. At the start of your LLDAP logs you'll see a dump of the config, as parsed. Can you confirm that the SMTP settings are as expected?
Also, try with SSL/port 465, I think people usually have better results with it (and it's a more secure protocol)
m
I believe so, this is what I'm seeing:
Copy code
smtp_options: MailOptions {
        enable_password_reset: true,
        from: Some(
            "LLDAP Admin <redacted>",
        ),
        reply_to: Some(
            "Do not reply <redacted>",
        ),
        server: "smtp.gmail.com",
        port: 587,
        user: "redacted",
        password: ***SECRET***,
        smtp_encryption: StartTls,
        ..
    },
and I started with that but I was running into the same issue which is why I switched
though SSL wasn't an option when I tried so I switched to TLS/465
"TLS" (sometimes called SSL, port 465) or "STARTTLS" (sometimes called TLS, port 587).
n
Vocabulary is awkward, yeah
m
as per the documentation ^
n
Yeah, so TLS
It's not the first time that someone has trouble with SMTP, but we're doing fairly straightforward things with it, just calling out to the lettre library
m
Right now all of my configurations are abstracted out into variables which I replaced for the message, could that be causing this?
Copy code
LDAP_SMTP_OPTIONS__FROM: LLDAP Admin <${SMTP_USER}>
LLDAP_SMTP_OPTIONS__PASSWORD: ${SMTP_PASSWORD}
LLDAP_SMTP_OPTIONS__PORT: ${SMTP_PORT}
LLDAP_SMTP_OPTIONS__REPLY_TO: Do not reply <${SMTP_USER}>
LLDAP_SMTP_OPTIONS__SERVER: ${SMTP_HOST}
LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION: ${SMTP_ENCRYPTION}
LLDAP_SMTP_OPTIONS__USER: ${SMTP_USER}
LLDAP_VERBOSE: true
n
That could be a quoting issue with the password
You can go into the container and echo the env variable, to see
m
good idea
I think I figured it out. I had a typo in my password variable while setting it, it was
SMTP_PASSWORDD
not
SMTP_PASSWORD
n
Yep, that's usually how it goes 😄
m
pretty sure this is solved but let me redeploy and double check
yep all good, thanks for your help 🙂