I'm pretty well versed in using header_checks/mime_header_checks to refuse smtp mail in Postfix, but now I think I've gone off the path of righteousness; I'm trying to suss out a way that I can refuse a message if it doesn't contain one of the following headers:
- application/pkcs7-signature
- application/x-pkcs7-signature
- application/pkcs7-mime
- application/x-pkcs7-mime
If it's not obvious, the intention is that the MTA should only accept mail that's either encrypted or signed using S/MIME. I know that I can process and then discard it after accepting it (this is the "standard" way of handling errors, according to the Direct Project), but if there's a way I can 5xx reject it before it gets that far, that's at least one possible case that doesn't have to disappear into the black hole.
My google-fu has failed me on this - I get many, many results on rejecting, but nothing on requiring, certain headers. So either it can't be done and I'm whistling into the wind, or my search terms just aren't matching up with what they need to be.