L
LLDAP7mo ago
Matéo

Matéo - Hey! I'm trying to configure emails wit...

Hey! I'm trying to configure emails with BREVO, but it seems like it's not taking into account the environment variables:
services:
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max_connections=1>
environment:
MYSQL_ROOT_PASSWORD: randompassword
volumes:
- ./db:/var/lib/mysql
restart: unless-stopped

lldap:
image: lldap/lldap:stable
ports:
- 3890:3890
- 6360:6360
- 17170:17170
volumes:
- ./data:/data
environment:
- LLDAP_VERBOSE=false
- UID=0
- GID=0
- TZ=Europe/Paris
- LLDAP_JWT_SECRET=random
- LLDAP_KEY_SEED=random
- LLDAP_LDAP_BASE_DN=dc=random,dc=fr
- LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET=true
- LLDAP_SMTP_OPTIONS__PASSWORD=random
- LLDAP_SMTP_OPTIONS__SERVER=smtp-relay.brevo.com
- LLDAP_SMTP_OPTIONS__PORT=587
- LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION=TLS
- LLDAP_SMTP_OPTIONS__FROM="LLDAP Admin <[email protected]>"
- LLDAP_SMTP_OPTIONS__REPLY_TO="Support <[email protected]>"
- LLDAP_DATABASE_URL=mysql://random:randompassword@db/lldap
services:
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max_connections=1>
environment:
MYSQL_ROOT_PASSWORD: randompassword
volumes:
- ./db:/var/lib/mysql
restart: unless-stopped

lldap:
image: lldap/lldap:stable
ports:
- 3890:3890
- 6360:6360
- 17170:17170
volumes:
- ./data:/data
environment:
- LLDAP_VERBOSE=false
- UID=0
- GID=0
- TZ=Europe/Paris
- LLDAP_JWT_SECRET=random
- LLDAP_KEY_SEED=random
- LLDAP_LDAP_BASE_DN=dc=random,dc=fr
- LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET=true
- LLDAP_SMTP_OPTIONS__PASSWORD=random
- LLDAP_SMTP_OPTIONS__SERVER=smtp-relay.brevo.com
- LLDAP_SMTP_OPTIONS__PORT=587
- LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION=TLS
- LLDAP_SMTP_OPTIONS__FROM="LLDAP Admin <[email protected]>"
- LLDAP_SMTP_OPTIONS__REPLY_TO="Support <[email protected]>"
- LLDAP_DATABASE_URL=mysql://random:randompassword@db/lldap
When I try to reset the password, it says it has been sent, but I don't receive anything and it doesn't display any errors.
No description
Solution:
That usually means that you have starttls with the SSL port or vice versa
Jump to solution
26 Replies
nitnelave
nitnelave7mo ago
Did you send a message in french before or did I hallucinate? 😄 If you start LLDAP with verbose true, it'll dump the config that it loaded at the top of the logs. Very useful to debug whether you have the right env variables
Matéo
MatéoOP7mo ago
Yes the automatic translation did not work x)
nitnelave
nitnelave7mo ago
Oh, and verbose will also tell you what's happening with the email, whether it actually tried to send it or not. If the username was not found it doesn't send the email but doesn't tell you about it (since that would leak the existing users or their emails)
Matéo
MatéoOP7mo ago
smtp_options: MailOptions {
lldap-1 | enable_password_reset: true,
lldap-1 | from: Some(
lldap-1 | Mailbox {
lldap-1 | name: Some(
lldap-1 | "\"LLDAP Admin",
lldap-1 | ),
lldap-1 | email: Address {
lldap-1 | serialized: "[email protected]",
lldap-1 | at_start: 8,
lldap-1 | },
lldap-1 | },
lldap-1 | ),
lldap-1 | reply_to: Some(
lldap-1 | Mailbox {
lldap-1 | name: Some(
lldap-1 | "Support",
lldap-1 | ),
lldap-1 | email: Address {
lldap-1 | serialized: "[email protected]",
lldap-1 | at_start: 7,
lldap-1 | },
lldap-1 | },
lldap-1 | ),
lldap-1 | server: "smtp-relay.brevo.com",
lldap-1 | port: 587,
lldap-1 | user: "secret",
lldap-1 | password: ***SECRET***,
lldap-1 | smtp_encryption: Tls,
lldap-1 | tls_required: None,
lldap-1 | },
smtp_options: MailOptions {
lldap-1 | enable_password_reset: true,
lldap-1 | from: Some(
lldap-1 | Mailbox {
lldap-1 | name: Some(
lldap-1 | "\"LLDAP Admin",
lldap-1 | ),
lldap-1 | email: Address {
lldap-1 | serialized: "[email protected]",
lldap-1 | at_start: 8,
lldap-1 | },
lldap-1 | },
lldap-1 | ),
lldap-1 | reply_to: Some(
lldap-1 | Mailbox {
lldap-1 | name: Some(
lldap-1 | "Support",
lldap-1 | ),
lldap-1 | email: Address {
lldap-1 | serialized: "[email protected]",
lldap-1 | at_start: 7,
lldap-1 | },
lldap-1 | },
lldap-1 | ),
lldap-1 | server: "smtp-relay.brevo.com",
lldap-1 | port: 587,
lldap-1 | user: "secret",
lldap-1 | password: ***SECRET***,
lldap-1 | smtp_encryption: Tls,
lldap-1 | tls_required: None,
lldap-1 | },
nitnelave
nitnelave7mo ago
And the logs from trying to reset a password?
Matéo
MatéoOP7mo ago
lldap-1 | 2024-05-30T14:14:24.033471855+00:00 DEBUG HTTP request [ 171µs | 100.00% ] method: "GET" | uri: "/reset-password/step1?"
lldap-1 | 2024-05-30T14:14:24.033647470+00:00 DEBUG ┕━ 🐛 [debug]: | status_code: 304
lldap-1 | 2024-05-30T14:14:24.033471855+00:00 DEBUG HTTP request [ 171µs | 100.00% ] method: "GET" | uri: "/reset-password/step1?"
lldap-1 | 2024-05-30T14:14:24.033647470+00:00 DEBUG ┕━ 🐛 [debug]: | status_code: 304
Matéo
MatéoOP7mo ago
No description
nitnelave
nitnelave7mo ago
Erf, that's a cache hit 😄 It shouldn't be a get request But a post Can you add a comment to issue 887? Or create a new issue, it's technically a different problem
Matéo
MatéoOP7mo ago
and why at one point did I still get an error when clicking on the button?
nitnelave
nitnelave7mo ago
If the server attempts to send an email but fails, you get an error in the frontend. After that it probably cached the error (or a success) and then just returned the cached value In the meantime you can clear your cache to get a proper response
Matéo
MatéoOP7mo ago
No description
Solution
nitnelave
nitnelave7mo ago
That usually means that you have starttls with the SSL port or vice versa
nitnelave
nitnelave7mo ago
SMTP configuration is very annoying because for them TLS means starttls, but its completely different, it's actually ssl
Matéo
MatéoOP7mo ago
What should I do?
nitnelave
nitnelave7mo ago
Your SMTP configuration is incorrect. You have the protocol and port mixed up. Ideally, switch everything to SSL (the SMTP encryption for LLDAP will be TLS, but the port should be the one listed for SSL)
Matéo
MatéoOP7mo ago
I deactivated it and it seems to work:
No description
Matéo
MatéoOP7mo ago
i set LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION to none
nitnelave
nitnelave7mo ago
Hmm, you can, but it's highly not recommended
Matéo
MatéoOP7mo ago
It was to test
nitnelave
nitnelave7mo ago
It means you're not encrypting the content of the email which contains the link to change your password (and take over your account)
Matéo
MatéoOP7mo ago
localhost ?
No description
nitnelave
nitnelave7mo ago
You need to set the LLDAP http url in the config
Matéo
MatéoOP7mo ago
He has a hole planned 🙂
nitnelave
nitnelave7mo ago
?
Matéo
MatéoOP7mo ago
You have planned everything x)
nitnelave
nitnelave7mo ago
Ah yes 🙂 Well, that's not quite true, but I try 🙂
Want results from more Discord servers?
Add your server