L
LLDAP4mo 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__USER=brevologin@gmail.com
- 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 <no-reply@random.fr>"
- LLDAP_SMTP_OPTIONS__REPLY_TO="Support <support@random.fr>"
- 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__USER=brevologin@gmail.com
- 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 <no-reply@random.fr>"
- LLDAP_SMTP_OPTIONS__REPLY_TO="Support <support@random.fr>"
- 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
nitnelave4mo 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éo4mo ago
Yes the automatic translation did not work x)
nitnelave
nitnelave4mo 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éo4mo 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: "no-reply@random.fr",
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: "support@random.fr",
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: "no-reply@random.fr",
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: "support@random.fr",
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
nitnelave4mo ago
And the logs from trying to reset a password?
Matéo
Matéo4mo 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éo4mo ago
No description
nitnelave
nitnelave4mo 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éo4mo ago
and why at one point did I still get an error when clicking on the button?
nitnelave
nitnelave4mo 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éo4mo ago
No description
Solution
nitnelave
nitnelave4mo ago
That usually means that you have starttls with the SSL port or vice versa
nitnelave
nitnelave4mo ago
SMTP configuration is very annoying because for them TLS means starttls, but its completely different, it's actually ssl
Matéo
Matéo4mo ago
What should I do?
nitnelave
nitnelave4mo 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)
Want results from more Discord servers?
Add your server