There are Perl modules for signing & verifying S/MIME - signed (and PGP -signed) e-mail.

I have the inverse problem: A mailing list filter that wants to unwrap signed messages (that is, remove the multipart/signed wrapper & corresponding signature, but retain the rest of the MIME structure). Verification is optional.

This turns out to be involved because headers have to move between the main message body and the sub parts, and there can be signed parts of a multipart (e.g. multipart/mixed or multipart/digest) message.

Before I undertake the chore of figuring this out: Has anyone done this or know of an existing module (or command)? FWIW: The messages have already been parsed by MIME::Parser (from MIME::Tools), but while adding parts to MIME::Entities is documented/discoverable, unwrapping doesn't seem to have been contemplated...

In case you're wondering, besides being big, signatures are invalidated by the filter, which modifies the messages - it removes certain content in the text sections and may even add attachments.

Also: These are cryptographic signatures, not the "signature" referred to in MIME::Tools.

Thanks in advance for any hints/pointers/code


In reply to Email: remove S/MIME or PGP signature? by tlhackque

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.