scVENUS / PeekabooAV

Peekaboo Extended Email Attachment Behavior Observation Owl
https://peekabooav.de
GNU General Public License v3.0
66 stars 20 forks source link

Content disposition #142

Closed michaelweiser closed 4 years ago

michaelweiser commented 4 years ago

amavis: Add content disposition to meta info

The content disposition of the original MIME part is interesting for deciding whether to ignore a sample or not because e.g. inline parts would likely never be offered to the user for opening with another application but rendered by the mail client instead.

Add extraction of the content disposition to our amavis plugin by monkey patching our way around some amavis internals. It's not pretty but works.

Register the new kind of meta info with Sample and add a property to access is. Extend the testsuite to check for regressions. Add an example rule to ruleset.conf.sample.

sample: Make meta info an implementation detail

Direct accesses to the metainfo* sample member variables have spread across the codebase again even though they were meant to become an implementation detail of sample and go away for good eventually. Therefore we add an accessor property for the declared MIME type and declare the meta info class members an implementation detail.

Remove usages in the test suite and in expressions in the ruleset.

Fix up the content disposition demo rule with the new type_declared property, because before we'd augment the mime type list with stuff like application/octet-stream which made it rather useless. Determining the need for analysis based solely on criteria the mail client would use also, like type-declared and content-disposition seems to make more sense.

michaelweiser commented 4 years ago

I opt to merge this unreviewed and deal with the fallout.