Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1106] Admin view of unmasked incoming message #7999

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

garethrees
Copy link
Member

Admins often want to view the contents of an incoming message without any masking or censor rules applied.

In some cases you can inspect the raw email, but it's often base64 encoded, which means needing to download the email and open it in a mail client. Even when the email is not base64 encoded, it's often difficult to mentally parse the information out when there are lots of headers, attachment sections and HTML body content.

This commit adds an unmasked view of main body part attachments. This is equivalent to the main body contents of an incoming message that we show in public.

This does require "downloading" the attachment from Active Storage, but at present we use local file storage for attachments, so that's fine. Even if we moved them to S3 it wouldn't be a disaster to fetch them each time, as this isn't a frequently viewed page.

Needed to use an !important CSS rule to improve the visual rendering as for some reason bootstrap sets margin-bottom: 0; on p tags within a blockquote element (See
bootstrap-sass-2.3.2.2/vendor/assets/stylesheets/bootstrap/_type.scss).

Fixes #1106.

Screenshot 2023-11-07 at 15 52 55

Copy link
Member

@gbp gbp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Added a fixup for slightly better styling - using EMs, remove the last margin and set the font size to match the rest of the content on the page.

image

Admins often want to view the contents of an incoming message without
any masking or censor rules applied.

In some cases you can inspect the raw email, but it's often base64
encoded, which means needing to download the email and open it in a mail
client. Even when the email is not base64 encoded, it's often difficult
to mentally parse the information out when there are lots of headers,
attachment sections and HTML body content.

This commit adds an unmasked view of main body part attachments. This is
equivalent to the main body contents of an incoming message that we show
in public.

This does require "downloading" the attachment from Active Storage, but
at present we use local file storage for attachments, so that's fine.
Even if we moved them to S3 it wouldn't be a disaster to fetch them each
time, as this isn't a frequently viewed page.

Needed to use an `!important` CSS rule to improve the visual rendering
as for some reason bootstrap sets `margin-bottom: 0;` on `p` tags within
a `blockquote` element (See
bootstrap-sass-2.3.2.2/vendor/assets/stylesheets/bootstrap/_type.scss).

Fixes #1106.
@garethrees garethrees force-pushed the 1106-unmasked-incoming-message-body branch from fb43721 to f6bbc01 Compare November 10, 2023 10:26
@garethrees garethrees merged commit f7420dc into develop Nov 10, 2023
3 checks passed
@garethrees garethrees deleted the 1106-unmasked-incoming-message-body branch November 10, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make decoded but unredacted version of incoming email available via admin interface
2 participants