mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
[GH-ISSUE #968] [BUG] unable to send_test_email: ERROR 🚨 [error]: Could not send email: Connection error: Connection error: received corrupt message: Connection error: received corrupt message: received corrupt message #351
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#351
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 @kelvtech-co-uk on GitHub (Sep 6, 2024).
Original GitHub issue: https://github.com/lldap/lldap/issues/968
Hi, sorry I cannot fathom this. I'm setting the SMTP values as docker environment variables. The host smpt.gmail.com responds to pings from inside the container without issue. Using a docker bridge network which houses other containers which can send emails fine with the same account e.g. authelia. Any help appreciated.
@nitnelave commented on GitHub (Sep 6, 2024):
That's strange. Usually this error means that you're using STARTTLS instead of TLS or vice versa. Can you try switching around the SMTP ports and protocols? Try the 4 combinations of (465, 587) x (TLS, STARTTLS)
@kelvtech-co-uk commented on GitHub (Sep 6, 2024):
So TLS on 465 and STARTTLS on 587 get further. Think i have a bad password so will recheck tomorrow and follow up. However that port and protocol combo is odd right?
@nitnelave commented on GitHub (Sep 6, 2024):
Yes, it should be the opposite.
Make sure you're using an app password for Gmail.
@kelvtech-co-uk commented on GitHub (Sep 7, 2024):
I cannot find a working combination. I've tried both an existing app password I have for authelia which is quite old as well as a newly generated one for lldap, but I can't see how this can be a credential issue on my side.
Anything else I can do to tshoot this?
My test command, just in case...
./lldap send_test_email -v --to my.email@gmail.com@kelvtech-co-uk commented on GitHub (Sep 7, 2024):
I turned on verbose logging to capture this but its not really saying much else I don't think?
@nitnelave commented on GitHub (Sep 7, 2024):
I can't help but think that "Username and Password not accepted" has something to do with your problem :)
How do you specify the password? If it's in a docker compose as env, the double quotes are usually not interpreted (meaning that it'll start your password with double quotes, making it invalid)
@kelvtech-co-uk commented on GitHub (Sep 7, 2024):
:-) I won't take offence...I'm expecting this to be a typo somewhere in my config lol. All settings are via a docker .env file as below. Ref the logouts above I shared, I had assumed the username/password messages were because of the protocol and port mismatch and Google declining the connections?
EDIT: Corrected the typo in the envirnonment variable name which was the source of my troubles.
@nitnelave commented on GitHub (Sep 7, 2024):
Erf, I got tricked again by the absolutely confusing general SMTP docs... They use TLS to mean STARTTLS, and they use SSL to mean (implicit) TLS. Whereas in LLDAP, the settings are the actual protocols of TLS or STARTTLS.
So yes, the best option is TLS, with port 465. STARTTLS with port 587 is also possible, but not recommended.
So we're back to the actual error of username/password not accepted, and that's a valid server-side response to a valid query (in the correct protocol, otherwise they wouldn't even be able to talk, thus the corrupted/incomplete messages when mixing up ports and protocols).
Can you try double-checking your settings, and maybe specifying the password in a file?
@kelvtech-co-uk commented on GitHub (Sep 7, 2024):
Urk, appreciate you wading thru that. Sure will retest tomorrow and move the password into a file. Will also check that password in another container to be sure.
@nitnelave commented on GitHub (Sep 7, 2024):
The confusing docs are a "known issue". I had a small attempt at clarifying the error message already in place, but it seems it didn't have a great coverage. Thanks to the comprehensive logs in this issue, I improved it: https://github.com/lldap/lldap/pull/970
@kelvtech-co-uk commented on GitHub (Sep 8, 2024):
Thank you @nitnelave, I'm now working using explicit TLS on port 465.
Once you cleared up the port confusion I spotted the problem 💩 was a typo with the naming of the env variable!
Apprecaite your time and help!
@nitnelave commented on GitHub (Sep 8, 2024):
I'll see if I can get a warning for typos in environment variables
@nitnelave commented on GitHub (Sep 8, 2024):
Here's for the next person with a typo in their env variable: https://github.com/lldap/lldap/pull/972