mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 16:25:55 +03:00
[GH-ISSUE #370] Strange formatting on password reset email link #140
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#140
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 @iplusplus42 on GitHub (Nov 15, 2022).
Original GitHub issue: https://github.com/lldap/lldap/issues/370
Hello! While testing my LLDAP configs, I found that the emailed password reset link isn't directly usable and appears to have been broken up by some kind of text wrapping. Below is the text from the email I received:
I could have something misconfigured somewhere, but I'm not sure. I'm running LLDAP v0.4.2-alpha on the lldap:latest Docker image. Please let me know if you need more information. Thank you!
@nitnelave commented on GitHub (Nov 15, 2022):
The domain part is taken from your configuration, the "http_url". Can you
double check it?
On Tue, 15 Nov 2022, 06:00 Andy Merrill, @.***> wrote:
@iplusplus42 commented on GitHub (Nov 15, 2022):
http_url = "https://ldap.example.com"That's what I have in my lldap_config.toml. It differs slightly from the link in my first comment, and that's because I noticed a few typos in the URL, but the issue still occurs. Thank you!
@nitnelave commented on GitHub (Nov 16, 2022):
Okay, I went through the code, I don't see any way that it would create this message.
However, looking at the body of the email, I see that it's aligned at 80 columns: I suspect either your SMTP relay and/or your email client of wrapping the message and adding the "=" when splitting the URL. Can you try sending the message from a different account, to a different account, or reading it with a different email client?
@ghost commented on GitHub (Jan 22, 2023):
I ran into this too.
lldapis the only program I have that generates these emails with=signs like this. All through amailbox.orgSMTP server. Other services include:I can't prove definitively that
lldapis the issue...but other programs through the same SMTP server aren't doing this, so idk.Ergo, for instance, sends a plaintext email for adding/changing an email to your account where the first line is
83characters (with my server name) and this weird=thing does not happen.Also on ergo: a password reset email (plaintext) contains a line that is
115characters and, again, this weird=thing does not happen.lldapseems to be doing line breaks with an equal sign (=) at 75 characters, for me.Unfortunately, verbose logging doesn't turn up anything especially helpful:
Curious about the
log.linelines with stuff about GitHub and cargo registries and such.In fact, if I take the exact same email and just remove the
=signs and send as plaintext via Thunderbird, it also sends correctly, with no weird line breaks.Are we positive this isn't some weird default setting of some upstream library or something?
@nitnelave commented on GitHub (Jan 22, 2023):
Alright, this seems to be a case of Quoted-printable encoding, where lines over 76 characters are escaped with an equal sign. It's a technically valid, if a bit old, encoding, that is usually supported by big clients.
I'll have a look to see if I can change the encoding.
@nitnelave commented on GitHub (Jan 22, 2023):
Note for the future, or if someone wants to take this up: in mail.rs, instead of using
body, we should usesinglepart: https://docs.rs/lettre/0.10.0-alpha.1/lettre/message/index.html#single-part@ghost commented on GitHub (Jan 22, 2023):
I don't know if this information is any additional help or not, but this is the encoding bits for how Thunderbird seems to send plaintext emails:
I see in
github.com/nitnelave/lldap@32f28d664e/server/Cargo.toml (L67-L70)that we're using version0.10.0-rc.3oflettre. So relevant source code inlettre:I don't know which encoding type would be the best to choose for compatibility (guessing
SevenBit/ASCII), but just getting the info out there for anyone who wants to take a crack at this. :)Edit: Maybe
EightBitfor future-proofing in case there's translations done forlldapat some point? Dunno.Edit 2: Never mind. I don't think that would actually help any with translations.
SevenBitprobably still makes the most sense, I guess.@nitnelave commented on GitHub (Jan 24, 2023):
The username can be UTF-8, so I'd like to have something that supports it.
Normally, lettre automatically chooses the appropriate encoding. I'm guessing here they went with QuotedPrintable for the long line, but even then, the client is supposed to support it correctly, that's a bog standard format.
I'm sorry for the users here, but it seems to be more of a SMTP server/email client problem than an LLDAP problem. Check with your email client whether they support the QuotedPrintable encoding, and if not, why not?
@ghost commented on GitHub (Jan 26, 2023):
I spent some time editing the source of the "problem" emails from
lldap.It looks like Thunderbird (and mailbox.org's webmail client, which I don't really use) seems to be upset that there's no
Content-Typeheader coming in. The second I add something likeContent-Type: text/plainthen it immediately displays as expected.As mentioned above, Tbird seems to set
Content-Type: text/plain; charset=UTF-8; format=flowedby default, but I don't really know whatformat=flowedis supposed to do. Removing or adding it didn't have any effect on the emails.Seems like simply adding
Content-Type: text/plain; charset=UTF-8might be the best bet to help clients that are expecting some sort ofContent-Type.@codestation commented on GitHub (Feb 13, 2023):
Same problem, the email is broken on RoundCube (Webmail app) and Gmail (Android App). Consider adding the
Content-Typeheader.@nitnelave commented on GitHub (Feb 14, 2023):
Last time I tried, there was a problem with the library making it hard to
do this simple thing. I'll have another look when I have a minute.
On Mon, 13 Feb 2023, 23:47 codestation, @.***> wrote:
@nitnelave commented on GitHub (Feb 14, 2023):
Thanks @wkeiuluf , that really helped! Can someone confirm that it's working correctly with the latest image?
@iplusplus42 commented on GitHub (Feb 14, 2023):
I can confirm that the email is working correctly! Thank you to everyone involved!
@codestation commented on GitHub (Feb 14, 2023):
Thank you. Can confirm is working with the email clients.