mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 18:26:29 +08:00
dede942007
This PR introduces a few important changes to secure media redaction in emails. First of all, two new site settings have been introduced: * `secure_media_allow_embed_images_in_emails`: If enabled we will embed secure images in emails instead of redacting them. * `secure_media_max_email_embed_image_size_kb`: The cap to the size of the secure image we will embed, defaulting to 1mb, so the email does not become too big. Max is 10mb. Works in tandem with `email_total_attachment_size_limit_kb`. `Email::Sender` will now attach images to the email based on these settings. The sender will also call `inline_secure_images` in `Email::Styles` after secure media is redacted and attachments are added to replace redaction messages with attached images. I went with attachment and `cid` URLs because base64 image support is _still_ flaky in email clients. All redaction of secure media is now handled in `Email::Styles` and calls out to `PrettyText.strip_secure_media` to do the actual stripping and replacing with placeholders. `app/mailers/group_smtp_mailer.rb` and `app/mailers/user_notifications.rb` no longer do any stripping because they are earlier in the pipeline than `Email::Styles`. Finally the redaction notice has been restyled and includes a link to the media that the user can click, which will show it to them if they have the necessary permissions. ![image](https://user-images.githubusercontent.com/920448/92341012-b9a2c380-f0ff-11ea-860e-b376b4528357.png) |
||
---|---|---|
.. | ||
client.ar.yml | ||
client.be.yml | ||
client.bg.yml | ||
client.bs_BA.yml | ||
client.ca.yml | ||
client.cs.yml | ||
client.da.yml | ||
client.de.yml | ||
client.el.yml | ||
client.en_US.yml | ||
client.en.yml | ||
client.es.yml | ||
client.et.yml | ||
client.fa_IR.yml | ||
client.fi.yml | ||
client.fr.yml | ||
client.gl.yml | ||
client.he.yml | ||
client.hu.yml | ||
client.hy.yml | ||
client.id.yml | ||
client.it.yml | ||
client.ja.yml | ||
client.ko.yml | ||
client.lt.yml | ||
client.lv.yml | ||
client.nb_NO.yml | ||
client.nl.yml | ||
client.pl_PL.yml | ||
client.pt_BR.yml | ||
client.pt.yml | ||
client.ro.yml | ||
client.ru.yml | ||
client.sk.yml | ||
client.sl.yml | ||
client.sq.yml | ||
client.sr.yml | ||
client.sv.yml | ||
client.sw.yml | ||
client.te.yml | ||
client.th.yml | ||
client.tr_TR.yml | ||
client.uk.yml | ||
client.ur.yml | ||
client.vi.yml | ||
client.zh_CN.yml | ||
client.zh_TW.yml | ||
names.yml | ||
plurals.rb | ||
server.ar.yml | ||
server.be.yml | ||
server.bg.yml | ||
server.bs_BA.yml | ||
server.ca.yml | ||
server.cs.yml | ||
server.da.yml | ||
server.de.yml | ||
server.el.yml | ||
server.en_US.yml | ||
server.en.yml | ||
server.es.yml | ||
server.et.yml | ||
server.fa_IR.yml | ||
server.fi.yml | ||
server.fr.yml | ||
server.gl.yml | ||
server.he.yml | ||
server.hu.yml | ||
server.hy.yml | ||
server.id.yml | ||
server.it.yml | ||
server.ja.yml | ||
server.ko.yml | ||
server.lt.yml | ||
server.lv.yml | ||
server.nb_NO.yml | ||
server.nl.yml | ||
server.pl_PL.yml | ||
server.pt_BR.yml | ||
server.pt.yml | ||
server.ro.yml | ||
server.ru.yml | ||
server.sk.yml | ||
server.sl.yml | ||
server.sq.yml | ||
server.sr.yml | ||
server.sv.yml | ||
server.sw.yml | ||
server.te.yml | ||
server.th.yml | ||
server.tr_TR.yml | ||
server.uk.yml | ||
server.ur.yml | ||
server.vi.yml | ||
server.zh_CN.yml | ||
server.zh_TW.yml | ||
transliterate.ar.yml | ||
transliterate.bg.yml | ||
transliterate.de.yml | ||
transliterate.el.yml | ||
transliterate.en.yml | ||
transliterate.ru.yml | ||
transliterate.vi.yml |