Sendmail doesn't encrypt email. Much as the name implies it sends mail... Encryption is entirely different in nature and in subject than sending e-mail is. To send an encrypted e-mail, there are 2 obvious steps.

1) Encrypt it.
2) Send it.


Ok, since your question is really more on the first, lets go ahead and answer it. There are many forms of encryption. There are many forms of encryption applicable to e-mail. There is one popular form of encryption that everyone has, that everyone recognizes, and that everyone uses. That is, everyone who encrypts their e-mail, and actually has a hand in deciding the technologies used and knows about them and such (IE, supposing AOL added "user friendly" encryption technology to their e-mail system, the users probably wouldn't consciously be doing much with it). That said. This form is PGP. There is also GPG, which is newer, and popular in the GPL community, but lets face it, not ALL of us here are part of that community. So, we'll focus on PGP. PGP is included with many linux distros, there is always a version that you can pipe through/insert something here/do whatever the heck you will with. There are hundreds of implementations, so you should be able to find one that runs on the platform you want, and that does what you want it to do.

The easiest way to do this in a perl script, (hence you posting this question to perlmonks), is with the crypt::PGP5 pm. USE this module, encrypt your e-mail with it, and then send as normal. This should be fairly self explainatory. PGP is public key encryption, so you will need to know the other party's public key before encrypting the mail, and you will need a private key to decode your mail. You might consider keeping a database of public keys on your computer, so that you can properly encrypt for all of your users.

HAVE FUN.

Just Another Perl Hacker

In reply to RE: e-mail encryption by Nitsuj
in thread email encryption by Anonymous Monk

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.