Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to send some sensitive data periodically to a set of recipients via email. Due to the nature of the data, we need to send it encrypted.

Some of our clients use PGP/GPG, so it's not an issue, but we have a few cases where the client is not allowed/does not want to use PGP, as they're already using S/MIME internally.

Is there a way to script/automate the process of encrypting and sending the email in those cases? Any tips/tricks?

For the moment, as they're not too many cases, we're solving it by emailing the PGP file to one of us and manually "converting" it to S/MIME email (basically, open PGP email, forward, send), but we'd like to do it in a "cleaner" way.

Thanks a lot

Javier

share|improve this question

1 Answer 1

Try:

$ openssl smime -sign -in cleartextmail.txt -signer my_cert.pem -text \
| openssl smime -encrypt \
-from you@example.com -to someone@example.org \
-subject "Signed and Encrypted message" \
-des3 user.pem | sendmail someone@example.org
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.