mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
[GH-ISSUE #365] email sending not working #139
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#139
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SaschMie on GitHub (Nov 3, 2022).
Original GitHub issue: https://github.com/lldap/lldap/issues/365
hey,
i have trouble with the emails. i did config my ftp server:
i know the data must be okey, because the same email config works on dublicati.
when i try a pw reset i get this in the log:
2022-11-03T12:49:36.947685461+00:00 INFO HTTP request [ 207ms | 100.00% ] 2022-11-03T12:49:36.947690074+00:00 INFO ┝━ i [info]: | uri: /auth/reset/step1/peter 2022-11-03T12:49:37.163010160+00:00 INFO ┕━ i [info]: | status_code: 200the gui says a reset token has been sent to your email.
But there is no mail, dublicati sends mails perfectly fine. What am i missing here?
@nitnelave commented on GitHub (Nov 3, 2022):
The frontend says that an email has been sent successfully if the user doesn't exist. From the logs (assuming that this is verbose logs) it seems that no email has been sent. Did you put a valid username there?
@SaschMie commented on GitHub (Nov 3, 2022):
yes the test user peter is created in lldap with a usable email address, so i dont know that the problem is. Nextcloud is sending emails to this smtp config.
@nitnelave commented on GitHub (Nov 3, 2022):
Did you set the logs to be verbose? If so, there should be more details about what's happening.
@SaschMie commented on GitHub (Nov 4, 2022):
i think it is set to info, dunno where to set it to verbose
@nitnelave commented on GitHub (Nov 4, 2022):
You can add
verbose=trueto the config, or start the program with--verbose. Or from the env variables, you can setLLDAP_VERBOSE=true.By the way, for these kinds of short questions or interactive debugging, you can try asking in Discord to get help faster.
@SaschMie commented on GitHub (Nov 6, 2022):
i dont like discord ;) so i have collected the debug log:
2022-11-06T13:34:55.635342702+00:00 INFO ┝━ i [info]: | uri: /auth/reset/step1/peter 2022-11-06T13:34:55.635355391+00:00 DEBUG ┝━ get_password_reset_step1 [ 253ms | 99.92% / 99.99% ] 2022-11-06T13:34:55.635357090+00:00 DEBUG │ ┝━ list_users [ 90.7µs | 0.04% ] 2022-11-06T13:34:55.635362652+00:00 DEBUG │ │ ┝━ 🐛 [debug]: | filters: Some(Or([UserId(UserId("peter")), Equality(Email, "peter")])) | get_groups: false 2022-11-06T13:34:55.635396081+00:00 DEBUG │ │ ┝━ 🐛 [debug]: | query: SELECT "users"."user_id", "email", "users"."display_name", "first_name", "last_name", "avatar", "users"."creation_date", "users"."uuid" FROM "users" WHERE "users"."user_id" = ? OR "users"."email" = ? ORDER BY "users"."user_id" ASC 2022-11-06T13:34:55.636219801+00:00 DEBUG │ │ ┕━ 🐛 [debug]: | return: [UserAndGroups { user: User { user_id: UserId("peter"), email: "mail@domain.de", display_name: "peter", first_name: "Peter", last_name: "Isman", avatar: JpegPhoto([]), creation_date: 2022-11-02T14:11:04.145337517Z, uuid: Uuid("someIDhere") }, groups: None }] 2022-11-06T13:34:55.636224404+00:00 DEBUG │ ┝━ start_password_reset [ 76.2µs | 0.03% ] 2022-11-06T13:34:55.636226421+00:00 DEBUG │ │ ┝━ 🐛 [debug]: | user: UserId("peter") 2022-11-06T13:34:55.636234210+00:00 DEBUG │ │ ┝━ 🐛 [debug]: | query: SELECT "user_id" FROM "users" WHERE "user_id" = ? 2022-11-06T13:34:55.636611202+00:00 DEBUG │ │ ┕━ 🐛 [debug]: | query: INSERT INTO "password_reset_tokens" ("token", "user_id", "expiry_date") VALUES (?, ?, ?) 2022-11-06T13:34:55.642721700+00:00 DEBUG │ ┝━ 🐛 [debug]: Sending email to 'mail@domain.de' as 'LLDAP <nobody@lldap>' via 'noreply@domain.de'@'mail.selfhost.de':'587' 2022-11-06T13:34:55.678539876+00:00 DEBUG │ ┝━ 🐛 [debug]: No cached session for DnsName(DnsName(DnsName("mail.selfhost.de"))) | log.target: "rustls::client::hs" | log.module_path: "rustls::client::hs" | log.file: "/__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.6/src/client/hs.rs" | log.line: 56 2022-11-06T13:34:55.678580204+00:00 DEBUG │ ┝━ 🐛 [debug]: Not resuming any session | log.target: "rustls::client::hs" | log.module_path: "rustls::client::hs" | log.file: "/__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.6/src/client/hs.rs" | log.line: 128 2022-11-06T13:34:55.695519493+00:00 DEBUG │ ┝━ 🐛 [debug]: ALPN protocol is None | log.target: "rustls::client::hs" | log.module_path: "rustls::client::hs" | log.file: "/__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.6/src/client/hs.rs" | log.line: 453 2022-11-06T13:34:55.695531084+00:00 DEBUG │ ┝━ 🐛 [debug]: Using ciphersuite TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 | log.target: "rustls::client::hs" | log.module_path: "rustls::client::hs" | log.file: "/__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.6/src/client/hs.rs" | log.line: 584 2022-11-06T13:34:55.695538518+00:00 DEBUG │ ┝━ 🐛 [debug]: Server supports tickets | log.target: "rustls::client::tls12::server_hello" | log.module_path: "rustls::client::tls12::server_hello" | log.file: "/__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.6/src/client/tls12.rs" | log.line: 82 2022-11-06T13:34:55.695808962+00:00 DEBUG │ ┝━ 🐛 [debug]: ECDHE curve is ECParameters { curve_type: NamedCurve, named_group: secp256r1 } | log.target: "rustls::client::tls12" | log.module_path: "rustls::client::tls12" | log.file: "/__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.6/src/client/tls12.rs" | log.line: 418 2022-11-06T13:34:55.695817677+00:00 DEBUG │ ┝━ 🐛 [debug]: Server DNS name is DnsName(DnsName(DnsName("mail.selfhost.de"))) | log.target: "rustls::client::tls12" | log.module_path: "rustls::client::tls12" | log.file: "/__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.6/src/client/tls12.rs" | log.line: 709 2022-11-06T13:34:55.704818589+00:00 DEBUG │ ┕━ 🐛 [debug]: Session saved | log.target: "rustls::client::tls12" | log.module_path: "rustls::client::tls12" | log.file: "/__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.6/src/client/tls12.rs" | log.line: 1020 2022-11-06T13:34:55.895037290+00:00 INFO ┕━ i [info]: | status_code: 200@nitnelave commented on GitHub (Nov 7, 2022):
Hmm, I don't see anything wrong with this log, it successfully sent an
email (reply 200 at the end).
On Sun, 6 Nov 2022, 14:38 Sascha, @.***> wrote:
@SaschMie commented on GitHub (Nov 7, 2022):
stange, there is no email on any reciever...i really dont get it actually. All other services are mailing normal with this data
@nitnelave commented on GitHub (Nov 7, 2022):
What version of LLDAP are you using? Which docker image, if any?
On Mon, Nov 7, 2022 at 11:54 AM Sascha @.***> wrote:
--
Valentin Tolmer
@SaschMie commented on GitHub (Nov 7, 2022):
Its LLDAP version 0.4.2-alpha and the the docker image is nitnelave/lldap
@nitnelave commented on GitHub (Nov 7, 2022):
Yes, but what tag of the docker image are you using?
latest?stable?The alpine version, or the debian one?
On Mon, Nov 7, 2022 at 11:58 AM Sascha @.***> wrote:
--
Valentin Tolmer
@SaschMie commented on GitHub (Nov 7, 2022):
dunno whats the defaukt when u not set one? i just have nitnelave/lldap, no other setting for latest, stable or something
@nitnelave commented on GitHub (Nov 7, 2022):
It should be the latest-alpine, then. Then to be fair I honestly don't
know. You can try asking the folks who maintain the
lettrerust crate,with the last few lines of the logs that you gave me (from "Sending email
to ") and a link to this line of code:
https://github.com/nitnelave/lldap/blob/main/server/src/infra/mail.rs#L17
On Mon, Nov 7, 2022 at 12:15 PM Sascha @.***> wrote:
--
Valentin Tolmer
@SaschMie commented on GitHub (Nov 22, 2022):
[debug]: Sending email to 'mail@domain.de' as 'LLDAP nobody@lldap' via 'mail'@'mail.selfhost.de':'587'
22.11.2022 17:55:48
Why is lldap sending as nobody@lldap, maybe this is a problem
Edit:
LLDAP_SMTP_OPTIONS__FROM solved the Problem.
The Link is send now, but not working:

22.11.2022 18:15:24 2022-11-22T17:15:24.109296457+00:00 INFO HTTP request [ 55.3µs | 100.00% ] 22.11.2022 18:15:24 2022-11-22T17:15:24.109301495+00:00 INFO ┝━ i [info]: | uri: //reset-password/step2/yyInswAH42Fg5qoWoh8laamh2AykP5gMmPNSFYPWz46zc6xCq8GN1hNwK5jvYwdcbgEgfwmcGjtfSdYkY3MmDtRcbKYoOy6mshUb 22.11.2022 18:15:24 2022-11-22T17:15:24.109361522+00:00 INFO ┕━ i [info]: | status_code: 200 22.11.2022 18:15:24 2022-11-22T17:15:24.553018140+00:00 INFO HTTP request [ 18.7µs | 100.00% ] 22.11.2022 18:15:24 2022-11-22T17:15:24.553023372+00:00 INFO ┝━ i [info]: | uri: /api/graphql 22.11.2022 18:15:24 2022-11-22T17:15:24.553057747+00:00 ERROR ┝━ 🚨 [error]: | error: AuthenticationError { challenge: Bearer { scope: None, realm: None, error: None, error_description: None, error_uri: None }, status_code: 401 } 22.11.2022 18:15:24 2022-11-22T17:15:24.553060797+00:00 WARN ┕━ 🚧 [warn]: Error encountered while processing the incoming HTTP request: AuthenticationError { challenge: Bearer { scope: None, realm: None, error: None, error_description: None, error_uri: None }, status_code: 401 }@nitnelave commented on GitHub (Nov 22, 2022):
What is the relevant (SMTP) part of your config, as printed at the
beginning when running in verbose mode?
On Tue, 22 Nov 2022, 17:58 Sascha, @.***> wrote:
@SaschMie commented on GitHub (Nov 22, 2022):
could fix it, the base url ended with / and it seems lldap dont like it. Now everything is working :)
@nitnelave commented on GitHub (Nov 23, 2022):
Oh, great :)
Which URL was the problem? I can try to make it more resilient.
@SaschMie commented on GitHub (Nov 23, 2022):
This one LLDAP_HTTP_URL, if there is a / at the end of the url, the recovery link fails.
btw, when a link was already used and you click it again, this error message is rly ugly :)
Could not validate token[500 Internal Server Error]:
Database error:no rows returned by a query that expected to return at least one row``