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

[#7877] Fix uuencoding attachment processing #7900

Merged
merged 3 commits into from
Sep 15, 2023

Commits on Sep 11, 2023

  1. Refactor MailHandler#get_attachment_attributes

    1. Replace output body_without_headers with original_body
    2. Use inject with accumulator when mapping over attachments
    
    These changes will make it easier to add additional processing into this
    method in the coming commits.
    gbp committed Sep 11, 2023
    Configuration menu
    Copy the full SHA
    5c639f5 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. Extract uuencoded attachments decoding

    Move Unix-to-Unix encoding [1] into the `MailHandler` as this will allow
    us to extract uuencoded attachments attributes without initialising
    `FoiAttachment` instances.
    
    [1] https://en.wikipedia.org/wiki/Uuencoding
    gbp committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    df7d524 View commit details
    Browse the repository at this point in the history
  2. Fix uuencoded attachment processing

    For attachments which are encoded with Unix-to-Unix encoding we are
    unable process some attachments in order to apply masks or censor rules
    to them.
    
    This is down to when the attachments are extracted and saved into the
    database. It happens outside of our `MailHandler` library which we're
    using to retrieve the original unmasked attachment body for processing.
    
    This change fixes this by checking plain text attachments for begin/end
    markers and calculating the relevant hexdigest for comparison.
    
    Fixes #7877
    gbp committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    f98545a View commit details
    Browse the repository at this point in the history