What exactly is digested in an S/MIME signated-only e-mail?
It's definitely not only a sha256-digest of the original message, which means that
$ openssl dgst -sha256 <<< "Text"
would never create the digest that is created for a S/MIME mail with the exact same "Text".
I've read and tried to understand information about this in RFC 5751 (in section 220.127.116.11), but it's still unclear to me, what exactly is digested for a S/MIME e-mail.
How is the original message prepared and enhanced before being hashed and encrypted?
If I understood correctly, some CMS processing and transfer-encoding is done for preparation. Is it possible to put the entire process into easy words?
Notes like these (in section 3.1) are even more confusing:
These (three) steps are descriptive rather than prescriptive. The implementer is free to use any procedure as long as the result is the same.
How can different e-mail-applications even work together on a basis of such vague descriptions?