Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Email: remove S/MIME or PGP signature?

by tlhackque (Beadle)
on Apr 09, 2017 at 08:20 UTC ( [id://1187513]=note: print w/replies, xml ) Need Help??


in reply to Re: Email: remove S/MIME or PGP signature?
in thread Email: remove S/MIME or PGP signature?

It's more complicated than stripping the signature. Just deleting the signature block produces a malformed message - and one that a good MUA will flag since it says it's signed, but no signature block is present. A regex isn't the problem - I can easily write those. The problem is that signing an e-mail takes headers (e.g. content-*) from the main body of the message and pushes them into a message/signed part - with a new boundary. Then the signature block is added, and the headers for the message/signed part replace those in the main body. I think that in theory, one message can have multiple signatures. To undo this requires finding the message/signed part, extracting its headers, deleting its headers & boundaries, deleting the signature block(s), and putting the headers back into the main message. The Content-type ;protocol field contains the MIME type for the signature. And, it can be necessary to do this recursively, since a message can consist of multiple signed parts (e.g. when a message contains several signed attached e-mails. Note that one can have pgp-signed attachments to an S/MIME-signed message. And vice-versa.) gpg delsig probably does the right thing for one level of PGP(I'm not a PGP user) - thanks for that suggestion. But will it handle a mix of PGP and S/MIME? And attachments (without detaching them?) S/MIME has the same issue, but I haven't found a tool for that. Anyhow, while I appreciate the suggestion, it doesn't solve the generic problem.
  • Comment on Re^2: Email: remove S/MIME or PGP signature?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1187513]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-26 01:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found