discourse/lib/email
Michael Brown 371eff1f66 FIX: Email::Cleaner must clear the encoding of replaced bodies
If this is *not* done, then the decoded body will already be considered to be
encoded, e.g.:

```
pry(main)> puts part
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: base64

PGh0bWw+PGhlYWQ+PC9oZWFkPjxib2R5Pjxicj48YnI+PGRpdiBjbGFzcz0i
cHJvdG9ubWFpbF9zaWduYXR1cmVfYmxvY2stdXNlciI+PC9kaXY+PGJyPjxi
cj5TZW50IGZyb20gPGEgdGFyZ2V0PSJfYmxhbmsiIGhyZWY9Imh0dHBzOi8v
cHJvdG9uLm1lL21haWwvaG9tZSIgcmVsPSJub3JlZmVycmVyIj5Qcm90b24g
TWFpbDwvYT4gZm9yIEFuZHJvaWQuPC9ib2R5PjwvaHRtbD4=

pry(main)> part.body = part.body.decoded
=> "<html><head></head><body><br><br><div class=\"protonmail_signature_block-user\"></div><br><br>Sent from <a target=\"_blank\" href=\"https://proton.me/mail/home\" rel=\"noreferrer\">Proton Mail</a> for Android.</body></html>"

pry(main)> puts part
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: base64

htmlhead/headbodybrbrdivclassprotonmailsignatureblockuser/di
vbrbrSentfromatargetblankhrefhttps//protonme/mail/homerelnor
eferrerProtonMail/aforAndroid/body/htmk=
```

Clearing the CTE indicates to the Mail gem that the content needs to be encoded
if necessary.
2026-01-15 13:05:25 -05:00
..
authentication_results.rb
build_email_helper.rb
cleaner.rb FIX: Email::Cleaner must clear the encoding of replaced bodies 2026-01-15 13:05:25 -05:00
message_builder.rb UX: add preview to email templates (#36657) 2026-01-08 11:33:53 +04:00
message_id_service.rb DEV: Remove old TODOs for message-id formats (#27196) 2024-05-28 13:57:09 +10:00
poller.rb
processor.rb
receiver.rb DEV: Remove IMAP support in Discourse (#37002) 2026-01-12 10:07:26 +10:00
renderer.rb UX: add preview to email templates (#36657) 2026-01-08 11:33:53 +04:00
sender.rb FIX: Extract readable string from Net::SMTP::Response in error logs 2026-01-07 14:33:07 +00:00
styles.rb UX: add preview to email templates (#36657) 2026-01-08 11:33:53 +04:00
validator.rb