Cryptographic Message Syntax (CMS), on which S/MIME is based, permits single pass processing by design.
This is from RFC 5652 Section 2:
As a general design philosophy, each content type permits single pass processing using indefinite-length Basic Encoding Rules (BER)encoding. Single-pass operation is especially helpful if content is large, stored on tapes, or is "piped" from another process.
The same holds true for MIME messages in general, nothing in their structure prevents single pass processing.
Such single pass processing (also called stream processing elsewhere) would be very interesting for me because I would like to be able to en-/decrypt or sign/validate very large MIME messages which may cause problems if loaded fully into memory, especially on low-end hardware. Whether or not it is recommended/possible to actually transfer such large messages via SMTP/POP3/IMAP doesn't matter to me because I plan to transfer them via other means.
As I understand it, the classes in the Rebex Secure Mail library don't support single pass processing but need to have the whole content in memory to perform any operations, including cryptographic, on it. Is that correct or is there actually a way to handle arbitrary sized messages?