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

[#7875] Block incoming messages parsing #7920

Merged
merged 10 commits into from
Sep 29, 2023

Conversation

gbp
Copy link
Member

@gbp gbp commented Sep 28, 2023

Relevant issue(s)

Connected to #7875
Depends on #7919

What does this do?

Block incoming messages parsing if hidden attachments will be removed.

Why was this needed?

To ensure hidden attachments aren't accidentally made visible again.

Clearer what you're getting and is more consistent with other factories.
Only generate 1 PDF attachment by default. This is consistent with other
factories.
Use trait to build instances with certain attachments.
Save confusing on what the after build/create are doing and any
conflicts which might occur. Ultimately the `plain_incoming_message`
should be removed.
Assign a re-built mail object to the `RawEmail` instance. This should
mean the `IncomingMessage` won't need to parsed within specs.

Needed to improve the spec support helper to build the mail object for a
given `IncomingMessage` to work with unsaved instances.
Simplify the after build callback by ensuring there will be a `body`,
`content_type` and `filename`.
Ensure we don't ever replace attachments which have been hidden using
prominence with newly parsed attachments.

This could in theory happen if the hexdigest which is based on the
attachment body changes. There have been occasions this has happened to
due to changes in the underlying mail gem and other parsing changes.

See: #7875
@gbp gbp merged commit 2a8edc3 into develop Sep 29, 2023
5 checks passed
gbp added a commit that referenced this pull request Oct 2, 2023
This check isn't doing anything. It was meant to protect when parsing
incoming messages to stop hidden attachments from being made public
again.

We don't actually yet have this parsing in place instead we've focused
on finding the original attachment [1].

For the remainder of cases we will need to parse the raw email again but
we have added separate check [2] so this one here is redundant.

[1] #7875
[2] #7920
gbp added a commit that referenced this pull request Oct 2, 2023
This check isn't doing anything. It was meant to protect when parsing
incoming messages to stop hidden attachments from being made public
again.

We don't actually yet have this parsing in place instead we've focused
on finding the original attachment [1].

For the remainder of cases we will need to parse the raw email again but
we have added separate check [2] so this one here is redundant.

[1] #7875
[2] #7920
gbp added a commit that referenced this pull request Oct 2, 2023
This check isn't doing anything. It was meant to protect when parsing
incoming messages to stop hidden attachments from being made public
again.

We don't actually yet have this parsing in place instead we've focused
on finding the original attachment [1].

For the remainder of cases we will need to parse the raw email again but
we have added separate check [2] so this one here is redundant.

[1] #7875
[2] #7920
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.

1 participant