is it possible to just filter attachments?
yes, for some reasonable definition of "attachment", it's possible.
but because MIME doesn't recognize a fundamental distinction between
attachments and other components, and because MIME doesn't separate
components from structure (it uses special body parts that contain
other body parts) a reasonable definition of "attachment" is a bit
tricky to get right.
probably what you want is something like:
- filter out every body part which isn't text/plain, message/rfc822,
image/*, a signature (there are several types), or a multipart/*
(filters apply recursively to components of message/rfc822 and multipart/*)
- if the resulting filter removes every component of a multipart or
a message/rfc822, also filter the enclosing multipart or message/rfc822.
- if this results in the entire message getting filtered, bounce the message
- otherwise, if any of the filtered contents appear to be critical (for
instance they are marked with content-disposition: inline), bounce the
message.
- otherwise, forward the message with the filtered contents removed
it's not exactly a SMOP.
Keith